:root {
    color-scheme: light;
    --bg: #e8efe4;
    --bg-deep: #d7e2d2;
    --paper: #fafcf7;
    --paper-strong: #ffffff;
    --ink: #243127;
    --muted: #687669;
    --line: rgba(62, 90, 67, 0.16);
    --line-strong: rgba(62, 90, 67, 0.28);
    --accent: #4f8b5a;
    --accent-deep: #35633d;
    --accent-soft: rgba(79, 139, 90, 0.12);
    --warning: #916523;
    --danger: #b44f4f;
    --success: #356b4b;
    --radius-xl: 30px;
    --radius-lg: 22px;
    --radius-md: 16px;
    --shadow-lg: 0 26px 50px rgba(64, 89, 63, 0.12);
    --shadow-md: 0 16px 28px rgba(64, 89, 63, 0.08);
    --ease-soft: cubic-bezier(0.2, 0.8, 0.2, 1);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

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

body {
    font-family: "Manrope", "Segoe UI", sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(255, 255, 255, 0.56), transparent 28%),
        linear-gradient(180deg, #eff4ea 0%, var(--bg) 44%, var(--bg-deep) 100%);
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(rgba(79, 139, 90, 0.04) 1px, transparent 1px),
        linear-gradient(90deg, rgba(79, 139, 90, 0.04) 1px, transparent 1px);
    background-size: 26px 26px;
    mask-image: linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 88%);
}

.shell {
    width: min(1440px, calc(100% - 40px));
    margin: 28px auto 42px;
    position: relative;
    z-index: 1;
}

.eyebrow,
.card-kicker,
.band-title {
    margin: 0;
    font-size: 0.74rem;
    font-weight: 800;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #6a7868;
}

h1,
h2,
h3,
strong {
    margin: 0;
    letter-spacing: -0.05em;
}

h1 {
    font-size: 30px;
    line-height: 1.04;
}

h2 {
    font-size: 1.6rem;
    line-height: 1.08;
}

h3 {
    font-size: 1.12rem;
    line-height: 1.1;
}

.lead,
.sheet-head p,
.legend-sheet p,
.status-sheet p,
.form-note,
.summary-copy,
.result-meta,
.notice,
.sidebar-card p {
    color: var(--muted);
}

.manifest-cover,
.legend-sheet,
.manifest-sheet,
.output-sheet,
.status-sheet,
.sidebar-card,
.notice {
    border: 1px solid var(--line);
    background: rgba(250, 252, 247, 0.92);
    box-shadow: var(--shadow-lg);
}

.manifest-cover {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 320px;
    gap: 28px;
    padding: 32px 34px;
    border-radius: 26px 26px 54px 26px;
    margin-bottom: 24px;
}

.cover-copy {
    display: grid;
    gap: 14px;
}

.lead {
    margin: 0;
    max-width: 66ch;
    line-height: 1.72;
}

.cover-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-content: start;
    justify-content: flex-end;
}

.cover-tags span {
    display: inline-flex;
    align-items: center;
    min-height: 42px;
    padding: 0 16px;
    border-radius: 999px;
    background: rgba(79, 139, 90, 0.1);
    border: 1px solid rgba(79, 139, 90, 0.14);
    color: var(--accent-deep);
    font-weight: 800;
}

.manifest-layout {
    display: grid;
    grid-template-columns: 270px minmax(0, 1fr) 320px;
    gap: 24px;
    align-items: start;
}

.legend-column,
.manifest-column,
.sidebar-column {
    display: grid;
    gap: 20px;
}

.legend-sheet,
.manifest-sheet,
.output-sheet,
.status-sheet,
.sidebar-card {
    padding: 24px;
    border-radius: 26px;
}

.legend-sheet {
    background: linear-gradient(180deg, rgba(250, 252, 247, 0.96), rgba(239, 245, 236, 0.94));
}

.legend-sheet-alt {
    background: linear-gradient(180deg, rgba(79, 139, 90, 0.12), rgba(250, 252, 247, 0.96));
}

.legend-list {
    margin: 18px 0 0;
    display: grid;
    gap: 14px;
}

.legend-list div {
    display: grid;
    gap: 4px;
    padding: 14px 0;
    border-bottom: 1px solid rgba(62, 90, 67, 0.1);
}

.legend-list div:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.legend-list dt {
    font-weight: 800;
}

.legend-list dd {
    margin: 0;
    color: var(--muted);
    line-height: 1.6;
}

.manifest-sheet,
.output-sheet {
    background: rgba(255, 255, 255, 0.78);
}

.sheet-head,
.output-header {
    display: grid;
    gap: 10px;
    margin-bottom: 22px;
}

.sheet-head p,
.output-header p {
    margin: 0;
    line-height: 1.7;
}

.utm-form {
    display: grid;
    gap: 20px;
}

.field {
    display: grid;
    gap: 10px;
}

.field > span {
    font-size: 0.94rem;
    font-weight: 800;
}

.parameter-bands {
    display: grid;
    gap: 18px;
}

.band {
    display: grid;
    gap: 14px;
    padding: 18px;
    border-radius: 20px;
    background: rgba(240, 246, 237, 0.88);
    border: 1px solid rgba(62, 90, 67, 0.1);
}

.field-grid {
    display: grid;
    gap: 16px;
}

.field-grid-two {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.field-grid-three {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

input {
    width: 100%;
    min-height: 56px;
    padding: 15px 16px;
    border-radius: 16px;
    border: 1px solid var(--line-strong);
    background: rgba(255, 255, 255, 0.92);
    color: var(--ink);
    font: inherit;
    transition: border-color 180ms var(--ease-soft), box-shadow 180ms var(--ease-soft), transform 180ms var(--ease-soft);
}

input::placeholder {
    color: #8d988c;
}

input:focus {
    outline: none;
    border-color: rgba(79, 139, 90, 0.4);
    box-shadow: 0 0 0 4px rgba(79, 139, 90, 0.12);
    transform: translateY(-1px);
}

.sheet-actions {
    display: grid;
    gap: 14px;
}

.action-row {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
}

button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 52px;
    padding: 0 20px;
    border-radius: 999px;
    border: 0;
    font: inherit;
    font-weight: 800;
    cursor: pointer;
    transition: transform 180ms var(--ease-soft), box-shadow 180ms var(--ease-soft), opacity 180ms var(--ease-soft);
}

button:hover:not(:disabled) {
    transform: translateY(-1px);
}

button:disabled {
    opacity: 0.55;
    cursor: not-allowed;
}

button[type="submit"],
#utm-copy {
    color: #fff;
    background: linear-gradient(180deg, var(--accent) 0%, var(--accent-deep) 100%);
    box-shadow: 0 12px 24px rgba(53, 99, 61, 0.18);
}

.ghost-button {
    color: var(--ink);
    background: rgba(255, 255, 255, 0.78);
    border: 1px solid var(--line);
}

.form-note {
    margin: 0;
    line-height: 1.65;
}

.notice {
    margin-top: 18px;
    padding: 16px 18px;
    border-radius: 18px;
}

.notice.error {
    color: var(--danger);
    background: #f9ecec;
}

.notice.success {
    color: var(--success);
    background: #eef7ef;
}

.url-output {
    padding: 18px 20px;
    border-radius: 18px;
    background: #eef5ec;
    border: 1px solid rgba(62, 90, 67, 0.12);
    font-family: "SFMono-Regular", Consolas, monospace;
    font-size: 0.95rem;
    line-height: 1.72;
    word-break: break-word;
}

.output-notes {
    margin-top: 20px;
    display: grid;
    gap: 16px;
}

.note-panel {
    padding: 18px;
    border-radius: 18px;
    background: rgba(245, 249, 243, 0.84);
    border: 1px solid rgba(62, 90, 67, 0.1);
}

.panel-head {
    display: grid;
    gap: 6px;
    margin-bottom: 12px;
}

.chip-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
}

.chip {
    display: inline-flex;
    align-items: center;
    min-height: 36px;
    padding: 0 14px;
    border-radius: 999px;
    background: rgba(79, 139, 90, 0.12);
    color: var(--accent-deep);
    font-size: 0.88rem;
    font-weight: 700;
}

.chip-empty {
    margin: 0;
    color: var(--muted);
}

.status-sheet {
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.9), rgba(244, 249, 241, 0.92));
}

.status-sheet strong {
    display: block;
    margin: 10px 0 8px;
    font-size: 1.5rem;
    line-height: 1.05;
}

.status-sheet-soft {
    background: linear-gradient(180deg, rgba(79, 139, 90, 0.1), rgba(255, 255, 255, 0.92));
}

.sidebar-card {
    background: rgba(255, 255, 255, 0.82);
}

.sidebar-card .ad-slot,
.sidebar-card .ad-placeholder {
    border-radius: 18px;
    border: 1px solid rgba(62, 90, 67, 0.12);
    background: rgba(243, 248, 241, 0.88);
}

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

@media (max-width: 920px) {
    .shell {
        width: min(100% - 24px, 100%);
    }

    .manifest-cover,
    .field-grid-two,
    .field-grid-three {
        grid-template-columns: 1fr;
    }

    .action-row {
        flex-direction: column;
        align-items: stretch;
    }

    button {
        width: 100%;
    }
}
