:root {
    --ink: #10231f;
    --muted: #62736e;
    --line: #dce7e2;
    --green: #087e68;
    --mint: #eaf7f1;
}

* { box-sizing: border-box; }

body {
    display: grid;
    min-height: 100vh;
    place-items: center;
    margin: 0;
    padding: 32px 20px;
    color: var(--ink);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Arial, sans-serif;
    background: #edf3f0;
    background-image: radial-gradient(circle at 10% 10%, #cef0e2 0, transparent 25rem), radial-gradient(circle at 92% 90%, #d7ebe4 0, transparent 27rem);
}

.panel {
    width: min(570px, 100%);
    padding: 36px;
    border: 1px solid #ffffffb8;
    border-radius: 24px;
    background: #fffffff2;
    box-shadow: 0 24px 60px #174b3b20, 0 2px 7px #174b3b0d;
}

.eyebrow { display: flex; align-items: center; gap: 8px; margin-bottom: 18px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: .11em; text-transform: uppercase; }
.eyebrow i { width: 8px; height: 8px; border-radius: 50%; background: #35b979; box-shadow: 0 0 0 4px #dbf5e9; }
h1 { margin: 0; font-size: clamp(27px, 5vw, 34px); line-height: 1.12; letter-spacing: -.045em; }
.lead { max-width: 430px; margin: 11px 0 29px; color: var(--muted); font-size: 14px; line-height: 1.55; }

label { display: block; margin: 0 0 7px; color: #3d514b; font-size: 12px; font-weight: 750; }
input, select { width: 100%; min-height: 46px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); font: 14px inherit; background: #fbfdfc; transition: border-color .18s, box-shadow .18s, background .18s; }
input:focus, select:focus { outline: 0; border-color: #53ae91; background: #fff; box-shadow: 0 0 0 4px #4eb58b22; }
input[type="file"] { position: absolute; width: 1px; height: 1px; overflow: hidden; opacity: 0; }

.file-drop { position: relative; display: flex; align-items: center; gap: 14px; min-height: 82px; margin: 0; padding: 15px; border: 1.5px dashed #98cabb; border-radius: 14px; color: var(--ink); background: linear-gradient(135deg, #f6fcf9, #eff9f4); cursor: pointer; transition: .18s ease; }
.file-drop:hover, .file-drop:focus-within { border-color: var(--green); background: #eaf8f1; transform: translateY(-1px); }
.file-icon { display: grid; flex: 0 0 42px; width: 42px; height: 42px; place-items: center; border-radius: 12px; color: var(--green); background: #d8f1e5; }
.file-copy { min-width: 0; }
.file-copy strong, .file-copy small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.file-copy strong { font-size: 13px; }
.file-copy small { margin-top: 4px; color: var(--muted); font-size: 11px; font-weight: 500; }
.file-tag { margin-left: auto; padding: 6px 8px; border-radius: 6px; color: var(--green); font-size: 10px; font-weight: 800; letter-spacing: .06em; background: #fff; text-transform: uppercase; }

.section-title { margin: 27px 0 10px; color: #3d514b; font-size: 12px; font-weight: 750; }
.grid, .actions { display: grid; grid-template-columns: 1fr 1fr; gap: 13px; margin-top: 15px; }
.field { margin-top: 18px; }
.field-note { margin: 4px 0 0; color: #81908b; font-size: 11px; }
.check { display: flex; align-items: center; gap: 9px; margin: 17px 0 0; color: #42544f; cursor: pointer; }
.check input { width: 16px; min-height: 16px; accent-color: var(--green); }
.divider { height: 1px; margin: 26px 0 0; background: #e7eeeb; }
.actions { align-items: stretch; width: 100%; column-gap: 14px; row-gap: 18px; margin-top: 20px; }

button { display: flex; align-items: center; justify-content: center; width: 100%; min-height: 48px; padding: 10px 14px; border: 0; border-radius: 10px; font: 750 13px inherit; line-height: 1.2; text-align: center; cursor: pointer; transition: transform .18s, box-shadow .18s, background .18s; }
button:not(:disabled):hover { transform: translateY(-1px); }
button:disabled { opacity: .5; cursor: not-allowed; }
.preview { color: var(--green); background: var(--mint); }
.build { color: #fff; background: linear-gradient(135deg, #0b9d7c, #087260); box-shadow: 0 8px 18px #07816b36; }
#status { min-height: 18px; margin: 15px 0 0; color: var(--muted); font-size: 12px; text-align: center; }

dialog { width: min(1200px, 96vw); height: min(900px, 92vh); padding: 0; border: 0; border-radius: 18px; overflow: hidden; box-shadow: 0 24px 80px #0008; }
dialog::backdrop { background: #001b1688; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 57px; padding: 0 16px 0 22px; color: #fff; background: #111b21; }
.bar span { display: block; margin-top: 2px; color: #aebac1; font-size: 12px; }
.close { width: auto; min-height: auto; color: #fff; background: #374248; }
iframe { display: block; width: 100%; height: calc(100% - 57px); border: 0; }

@media (max-width: 450px) {
    body { display: block; padding: 0; background: #f4f8f6; }
    .panel { width: 100%; min-height: 100vh; padding: 28px 20px calc(28px + env(safe-area-inset-bottom)); border: 0; border-radius: 0; box-shadow: none; }
    .eyebrow { margin-bottom: 14px; }
    h1 { font-size: 29px; }
    .lead { margin-bottom: 24px; }
    .file-drop { min-height: 76px; padding: 12px; gap: 11px; }
    .file-icon { flex-basis: 38px; width: 38px; height: 38px; }
    .file-tag { display: none; }
    .grid { grid-template-columns: 1fr; gap: 12px; }
    .actions { grid-template-columns: 1fr 1.25fr; gap: 10px; }
    button { min-height: 50px; }
    dialog { width: 100vw; height: 100dvh; max-width: none; max-height: none; border-radius: 0; }
    .bar { height: 60px; padding: 0 12px 0 16px; }
    .bar span { display: none; }
    iframe { height: calc(100% - 60px); }
}
