:root {
	--green: #72a02a;
	--green-dark: #5a8020;
	--green-light: #e8f5d4;
	--green-subtle: #f4faeb;
	--orange: #e8913a;
	--page-bg: #f5f8fa;
	--card-bg: #fff;
	--text: #222;
	--muted: #4b5563;
	--border: #dbe6ed;
	--danger: #b42318;
	--radius: 12px;
	--shadow: 2px 2px 7px rgba(0, 0, 0, .07);
	--shadow-hover: 0 8px 32px rgba(0, 0, 0, .12);
}
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body { font-family: 'Open Sans', system-ui, sans-serif; background: var(--page-bg); color: var(--text); -webkit-font-smoothing: antialiased; display: flex; flex-direction: column; }
h1, h2, h3 { font-family: 'Poppins', sans-serif; line-height: 1.2; margin: 0 0 .5rem; }
h1 { font-size: clamp(1.6rem, 3.5vw, 2.25rem); font-weight: 800; letter-spacing: -.02em; }
h2 { font-size: 1.35rem; font-weight: 700; }
p { line-height: 1.6; margin: 0 0 1rem; }
a { color: var(--green-dark); }
button { font: inherit; cursor: pointer; }
[hidden] { display: none !important; }

.topbar { display: flex; align-items: center; gap: 16px; padding: 10px 20px; background: #fff; border-bottom: 1px solid var(--border); min-height: 58px; }
.brand { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--text); font-family: 'Poppins', sans-serif; font-weight: 800; font-size: 1.15rem; }
.brand img { width: 30px; height: 30px; }
.brand em { font-style: normal; color: var(--green); }
.topbar-site { display: flex; align-items: center; gap: 10px; min-width: 0; }
.topbar-site strong { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 30vw; }
.topbar-actions { margin-left: auto; display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
.pill { font-size: .78rem; padding: 3px 10px; border-radius: 99px; background: #eef2f5; color: var(--muted); white-space: nowrap; }
.pill.ok { background: var(--green-light); color: var(--green-dark); }
.pill.warn { background: #fdf0e1; color: #9a5413; }

main { flex: 1; padding: 32px 16px 64px; }
.wrap { max-width: 720px; margin: 0 auto; }
.wrap.wide { max-width: 980px; }
.card { background: var(--card-bg); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 28px; margin-bottom: 20px; }
.lede { color: var(--muted); font-size: 1.05rem; }
.eyebrow { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--green-dark); font-weight: 700; margin-bottom: 8px; }

.steps { display: flex; gap: 6px; justify-content: center; margin: 0 auto 24px; }
.steps span { width: 34px; height: 6px; border-radius: 6px; background: var(--border); }
.steps span.on { background: var(--green); }

label.field { display: block; font-weight: 600; margin: 0 0 6px; }
.hint { color: var(--muted); font-size: .9rem; margin: 6px 0 0; }
textarea, input[type=text] { width: 100%; font: inherit; padding: 12px 14px; border: 1px solid var(--border); border-radius: 10px; background: #fff; color: var(--text); }
textarea:focus, input[type=text]:focus { outline: 2px solid var(--green); outline-offset: 1px; border-color: var(--green); }
textarea { min-height: 150px; resize: vertical; line-height: 1.55; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 10px; padding: 12px 22px; font-weight: 700; background: var(--green); color: #fff; text-decoration: none; transition: background .2s; }
.btn:hover { background: var(--green-dark); }
.btn:disabled { opacity: .55; cursor: default; }
.btn-sm { padding: 8px 14px; font-size: .9rem; }
.btn-light { background: #fff; color: var(--text); border: 1px solid var(--border); }
.btn-light:hover { background: #f3f6f8; }
.btn-orange { background: var(--orange); }
.btn-orange:hover { background: #cf7a26; }
.btn-ghost { background: none; border: 0; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: .88rem; }
.btn-ghost:hover { background: #eef2f5; color: var(--text); }
.btn-danger { color: var(--danger); }
.row { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }
.row.end { justify-content: flex-end; }
.row.between { justify-content: space-between; }
.spacer { flex: 1; }

.dropzone { display: block; border: 2px dashed var(--border); border-radius: var(--radius); padding: 18px; text-align: center; color: var(--muted); background: #fbfcfd; cursor: pointer; transition: border-color .2s, background .2s; }
.dropzone.over { border-color: var(--green); background: var(--green-subtle); }
.dropzone input { display: none; }
.dropzone strong { color: var(--green-dark); }
.files { list-style: none; padding: 0; margin: 12px 0 0; display: grid; gap: 8px; }
.files li { display: flex; align-items: center; gap: 10px; padding: 8px 10px; background: #f7f9fa; border-radius: 8px; font-size: .9rem; }
.files img { width: 40px; height: 40px; object-fit: cover; border-radius: 6px; background: #e6ecef; }
.files .doc { width: 40px; height: 40px; border-radius: 6px; background: #e6ecef; display: grid; place-items: center; font-size: .7rem; font-weight: 700; color: var(--muted); }
.files select { font: inherit; font-size: .85rem; padding: 4px 6px; border-radius: 6px; border: 1px solid var(--border); }
.files .name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0; }
.chip { border: 1px solid var(--border); background: #fff; border-radius: 99px; padding: 8px 14px; font-size: .95rem; }
.chip:hover { border-color: var(--green); }
.chip.on { background: var(--green-light); border-color: var(--green); color: var(--green-dark); font-weight: 600; }
.qwhy { color: var(--muted); font-size: .9rem; }

.review dt { font-weight: 700; margin-top: 14px; }
.review dd { margin: 4px 0 0; color: var(--muted); white-space: pre-wrap; }

.tpl-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 14px; margin-top: 12px; }
.tpl { border: 2px solid var(--border); border-radius: var(--radius); background: #fff; padding: 0; overflow: hidden; text-align: left; transition: border-color .2s, box-shadow .2s; }
.tpl:hover { box-shadow: var(--shadow-hover); }
.tpl.on { border-color: var(--green); }
.tpl .shot { aspect-ratio: 16 / 10; background: #e9eef1 center top / cover no-repeat; display: grid; place-items: center; color: var(--muted); font-weight: 700; }
.tpl .meta { padding: 10px 12px; }
.tpl .meta strong { display: block; font-family: 'Poppins', sans-serif; }
.tpl .meta span { font-size: .82rem; color: var(--muted); }

.progress { height: 8px; border-radius: 8px; background: #e7edf1; overflow: hidden; margin: 18px 0 10px; }
.progress div { height: 100%; width: 0; background: var(--green); transition: width .6s ease; }
.checklist { list-style: none; padding: 0; margin: 14px 0 0; }
.checklist li { padding: 6px 0 6px 30px; position: relative; color: var(--muted); }
.checklist li::before { content: ''; position: absolute; left: 4px; top: 10px; width: 14px; height: 14px; border-radius: 50%; border: 2px solid var(--border); }
.checklist li.doing { color: var(--text); }
.checklist li.doing::before { border-color: var(--green); border-top-color: transparent; animation: spin .8s linear infinite; }
.checklist li.done { color: var(--text); }
.checklist li.done::before { background: var(--green); border-color: var(--green); }
@keyframes spin { to { transform: rotate(360deg); } }

.sites { display: grid; gap: 12px; }
.site-row { display: flex; align-items: center; gap: 14px; }
.site-row .info { flex: 1; min-width: 0; }
.site-row .info strong { display: block; font-family: 'Poppins', sans-serif; }
.site-row .info span { color: var(--muted); font-size: .88rem; }

.stage { flex: 1; display: flex; flex-direction: column; min-height: 0; }
.stage-bar { display: flex; align-items: center; gap: 4px; padding: 6px 12px; background: #fff; border-bottom: 1px solid var(--border); overflow-x: auto; }
.stage-url { margin-left: auto; font-size: .78rem; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 40vw; }
.stage iframe { flex: 1; width: 100%; border: 0; background: #fff; min-height: 70vh; }
body.on-stage main { flex: 0; padding: 0; }
.stage.offscreen { position: fixed; left: -10000px; top: 0; width: 1280px; height: 800px; }

.notice { border-radius: 10px; padding: 12px 14px; background: #eef6ff; color: #1d4f7a; margin: 0 0 16px; font-size: .95rem; }
.notice.warn { background: #fdf0e1; color: #7a420f; }
.notice.err { background: #fde8e7; color: var(--danger); }

.toast { position: fixed; bottom: 20px; left: 50%; transform: translateX(-50%); background: #1f2933; color: #fff; padding: 10px 16px; border-radius: 10px; font-size: .92rem; box-shadow: var(--shadow-hover); z-index: 50; max-width: calc(100% - 32px); }

dialog { border: 0; border-radius: var(--radius); padding: 24px; max-width: 480px; box-shadow: var(--shadow-hover); }
dialog::backdrop { background: rgba(15, 23, 42, .45); }

@media (max-width: 640px) {
	.card { padding: 20px; }
	.topbar { padding: 8px 12px; flex-wrap: wrap; }
	.topbar-site strong { max-width: 50vw; }
	.stage-url { display: none; }
}
