:root {
    --bg: #f4f6f1;
    --surface: #ffffff;
    --surface-soft: #eef2ea;
    --surface-muted: #e4e9de;

    --text: #1f2a24;
    --text-muted: #667267;
    --text-soft: #899287;

    --green-dark: #30483b;
    --green: #526f5a;
    --green-soft: #dfe8dc;
    --green-pale: #edf3ea;

    --border: #d8ded3;
    --border-strong: #c2ccbc;

    --danger: #8a3d3d;
    --danger-bg: #f4e8e6;

    --shadow: 0 18px 45px rgba(45, 62, 52, 0.08);

    --radius-lg: 16px;
    --radius-md: 10px;
    --radius-sm: 8px;

    --max-width: 1180px;
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
}

body {
    margin: 0;
    min-height: 100%;
    font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(141, 160, 131, 0.22), transparent 34%),
        linear-gradient(135deg, #f7f8f4 0%, var(--bg) 48%, #eef3ea 100%);
    line-height: 1.55;
}

a {
    color: var(--green-dark);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

button,
input,
textarea,
select {
    font: inherit;
}

.app-shell {
    width: min(100% - 32px, var(--max-width));
    margin: 0 auto;
    padding: 34px 0 56px;
}

.page {
    display: grid;
    gap: 24px;
}

.hero,
.page-header {
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    gap: 24px;
    padding: 8px 2px 2px;
}

.hero {
    max-width: 820px;
}

.eyebrow {
    margin: 0 0 8px;
    font-size: 12px;
    line-height: 1.2;
    font-weight: 800;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--green);
}

.error-eyebrow {
    color: var(--danger);
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    margin-bottom: 14px;
    max-width: 860px;
    font-size: clamp(34px, 5vw, 58px);
    line-height: 0.98;
    letter-spacing: -0.055em;
    color: var(--text);
}

h2 {
    margin-bottom: 14px;
    font-size: clamp(22px, 2.4vw, 30px);
    line-height: 1.12;
    letter-spacing: -0.035em;
}

h3 {
    margin-bottom: 10px;
    font-size: 20px;
    line-height: 1.2;
    letter-spacing: -0.02em;
}

.lead {
    margin-bottom: 0;
    max-width: 780px;
    color: var(--text-muted);
    font-size: clamp(16px, 1.9vw, 19px);
}

.card {
    background: rgba(255, 255, 255, 0.86);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow);
    padding: clamp(20px, 3.2vw, 34px);
}

.form {
    display: grid;
    gap: 22px;
}

.form-group {
    display: grid;
    gap: 9px;
}

label {
    font-weight: 720;
    color: var(--green-dark);
}

label span {
    color: var(--danger);
}

input,
textarea,
select {
    width: 100%;
    border: 1px solid var(--border-strong);
    border-radius: var(--radius-md);
    background-color: #fff;
    color: var(--text);
    padding: 14px 15px;
    outline: none;
    transition:
        border-color 0.18s ease,
        box-shadow 0.18s ease,
        background-color 0.18s ease;
}

select {
    appearance: none;
    -webkit-appearance: none;
    padding-right: 52px;
    background-image:
        linear-gradient(45deg, transparent 50%, var(--green-dark) 50%),
        linear-gradient(135deg, var(--green-dark) 50%, transparent 50%);
    background-position:
        calc(100% - 28px) 50%,
        calc(100% - 21px) 50%;
    background-size:
        7px 7px,
        7px 7px;
    background-repeat: no-repeat;
}

textarea {
    resize: vertical;
    min-height: 180px;
}

input:focus,
textarea:focus,
select:focus {
    border-color: var(--green);
    box-shadow: 0 0 0 4px rgba(82, 111, 90, 0.14);
}

input::placeholder,
textarea::placeholder {
    color: var(--text-soft);
    transition: color 0.15s ease;
}

input:focus::placeholder,
textarea:focus::placeholder {
    color: transparent;
}

.field-hint {
    margin: 0;
    color: var(--text-muted);
    font-size: 14px;
}

.actions {
    display: flex;
    justify-content: flex-start;
    align-items: center;
    gap: 12px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.btn-primary,
.btn-secondary,
.copy-btn {
    border: 0;
    cursor: pointer;
    border-radius: var(--radius-md);
    font-weight: 760;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease,
        background-color 0.15s ease;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 13px 22px;
    color: #fff;
    background: linear-gradient(135deg, var(--green-dark), var(--green));
    box-shadow: 0 12px 28px rgba(48, 72, 59, 0.22);
}

.btn-primary.small {
    min-height: 42px;
    padding: 10px 16px;
    font-size: 14px;
}

.btn-secondary {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 44px;
    padding: 11px 18px;
    color: var(--green-dark);
    background: var(--green-pale);
    border: 1px solid var(--green-soft);
}

.copy-btn {
    min-height: 34px;
    padding: 7px 12px;
    color: var(--green-dark);
    background: var(--surface-soft);
    border: 1px solid var(--border);
    font-size: 13px;
}

.btn-primary:hover {
    background: linear-gradient(135deg, #263a30, #486450);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-secondary:hover {
    background: var(--green-soft);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    text-decoration: none;
}

.copy-btn:hover {
    background: var(--green-soft);
    border-color: var(--border-strong);
    transform: translateY(-1px);
    text-decoration: none;
}

.btn-primary:active,
.btn-secondary:active,
.copy-btn:active {
    transform: translateY(0);
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
}

.summary-card {
    padding: 18px 20px;
    border-radius: var(--radius-md);
    background: var(--surface-soft);
    border: 1px solid var(--border);
}

.summary-card span,
.data-list span,
.meta-line span {
    display: block;
    margin-bottom: 5px;
    color: var(--text-muted);
    font-size: 13px;
    font-weight: 680;
}

.summary-card strong,
.data-list strong,
.meta-line strong {
    color: var(--text);
    font-size: 16px;
}

.result-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.result-card {
    padding: clamp(18px, 2.4vw, 26px);
}

.result-head {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 18px;
    margin-bottom: 14px;
}

.result-head h2 {
    margin-bottom: 0;
}

.copy-field {
    padding: 16px;
    min-height: 56px;
    border-radius: var(--radius-md);
    background: var(--green-pale);
    border: 1px solid var(--green-soft);
    overflow-wrap: anywhere;
    white-space: pre-wrap;
}

.mono {
    font-family: "SFMono-Regular", Consolas, "Liberation Mono", monospace;
    font-size: 14px;
}

.keywords {
    color: var(--text-muted);
}

.description-card {
    display: grid;
    gap: 16px;
}

.copy-check {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 22px;
    height: 22px;
    margin-left: 8px;
    border-radius: 50%;
    background: var(--green);
    color: #fff;
    font-size: 14px;
    line-height: 1;
    font-weight: 800;
    opacity: 0;
    transform: scale(0.85);
    transition: opacity 0.18s ease, transform 0.18s ease;
    vertical-align: middle;
}

.copy-check.visible {
    opacity: 1;
    transform: scale(1);
}

.rich-description {
    padding: clamp(18px, 3vw, 30px);
    border-radius: var(--radius-lg);
    background: #fff;
    border: 1px solid var(--border);
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.rich-description h2 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: clamp(24px, 3vw, 34px);
    color: var(--green-dark);
}

.rich-description h3 {
    margin-top: 26px;
    margin-bottom: 12px;
    color: var(--green-dark);
}

.rich-description p {
    margin-bottom: 14px;
}

.rich-description ul {
    margin: 0 0 18px;
    padding-left: 22px;
}

.rich-description li {
    margin-bottom: 8px;
}

.error-card {
    background: var(--danger-bg);
    border-color: rgba(138, 61, 61, 0.22);
}

.error-card h2 {
    color: var(--danger);
}

.meta-line {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(138, 61, 61, 0.18);
}

.data-list {
    display: grid;
    gap: 18px;
}

.data-list p {
    margin-bottom: 0;
    color: var(--text-muted);
}

@media (max-width: 820px) {
    .app-shell {
        width: min(100% - 24px, var(--max-width));
        padding-top: 22px;
    }

    .page-header {
        align-items: flex-start;
        flex-direction: column;
    }

    .summary-grid,
    .result-grid {
        grid-template-columns: 1fr;
    }

    .result-head {
        flex-direction: column;
        align-items: flex-start;
    }

    .result-head .btn-primary,
    .result-head .btn-secondary,
    .result-head .copy-btn {
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        width: 100%;
    }
}

@media (max-width: 520px) {
    .app-shell {
        width: min(100% - 18px, var(--max-width));
        padding-top: 18px;
        padding-bottom: 36px;
    }

    .hero,
    .page-header {
        padding-top: 0;
    }

    input,
    textarea,
    select {
        padding: 13px;
        border-radius: var(--radius-md);
    }

    select {
        padding-right: 48px;
        background-position:
            calc(100% - 26px) 50%,
            calc(100% - 19px) 50%;
    }

    .rich-description {
        padding: 16px;
    }
}

.error-message {
    margin-bottom: 0;
    color: var(--danger);
    font-size: 18px;
    font-weight: 650;
}

.topbar {
    display: flex;
    justify-content: flex-end;
    align-items: center;
    gap: 12px;
    margin-bottom: 22px;
}

.user-badge {
    display: inline-flex;
    align-items: center;
    min-height: 38px;
    padding: 8px 13px;
    border-radius: var(--radius-md);
    background: rgba(255, 255, 255, 0.72);
    border: 1px solid var(--border);
    color: var(--text-muted);
    font-size: 14px;
    font-weight: 680;
}

.topbar-logout {
    min-height: 38px;
    padding: 8px 14px;
    font-size: 14px;
}

@media (max-width: 520px) {
    .topbar {
        justify-content: stretch;
        align-items: stretch;
        flex-direction: column;
        margin-bottom: 18px;
    }

    .user-badge,
    .topbar-logout {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}