:root {
    --bg-top: #f4f8f5;
    --bg-bottom: #e6eef6;
    --ink: #122230;
    --muted: #4b5c6f;
    --line: #d7e2ed;
    --card: rgba(255, 255, 255, 0.9);
    --card-strong: #ffffff;
    --brand: #0f9d85;
    --brand-strong: #087a66;
    --accent: #ff8f3c;
    --danger: #d53a45;
    --success: #1d8c46;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

body {
    font-family: 'Pretendard', 'Apple SD Gothic Neo', 'Noto Sans KR', -apple-system, sans-serif;
    color: var(--ink);
    min-height: 100vh;
    background: radial-gradient(1200px 520px at 10% -10%, #d2f0ea 0%, transparent 55%),
        radial-gradient(1000px 450px at 100% 0%, #ffe3cc 0%, transparent 50%),
        linear-gradient(180deg, var(--bg-top) 0%, var(--bg-bottom) 100%);
    display: flex;
    justify-content: center;
    padding: 34px 18px;
}

.ambient {
    position: fixed;
    inset: 0;
    pointer-events: none;
    background-image: linear-gradient(rgba(18, 34, 48, 0.03) 1px, transparent 1px),
        linear-gradient(90deg, rgba(18, 34, 48, 0.03) 1px, transparent 1px);
    background-size: 24px 24px;
    mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.28), transparent 80%);
}

.container {
    width: 100%;
    max-width: 720px;
    position: relative;
    z-index: 1;
}

.hero {
    margin-bottom: 14px;
    padding: 10px 2px;
    animation: rise-in 520ms ease-out both;
}

.badge {
    display: inline-block;
    border: 1px solid #b8d8d1;
    background: #effaf8;
    color: #0a7664;
    border-radius: 999px;
    font-size: 12px;
    padding: 5px 10px;
    font-weight: 700;
    letter-spacing: 0.02em;
}

h1 {
    font-size: clamp(25px, 3vw, 33px);
    line-height: 1.2;
    margin-top: 10px;
    letter-spacing: -0.03em;
}

.hero p {
    margin-top: 8px;
    color: var(--muted);
    font-size: 15px;
}

.panel {
    background: var(--card);
    backdrop-filter: blur(8px);
    border: 1px solid rgba(255, 255, 255, 0.75);
    box-shadow: 0 16px 50px rgba(12, 26, 38, 0.12);
    border-radius: 22px;
    padding: 26px;
    animation: rise-in 680ms ease-out both;
}

.subpage-panel {
    display: grid;
    gap: 16px;
}

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

.subpage-nav.single {
    grid-template-columns: 1fr;
}

.section-title {
    font-size: 17px;
    letter-spacing: -0.01em;
}

.example-figure {
    border: 1px solid #dae6f1;
    border-radius: 14px;
    overflow: hidden;
    background: #f5f9fc;
}

.examples-layout {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(260px, 0.75fr);
    gap: 18px;
    align-items: start;
}

.examples-content {
    display: grid;
    gap: 16px;
}

.platform-samples {
    border: 1px solid #dbe7f1;
    border-radius: 14px;
    padding: 14px;
    background: #f8fcff;
}

.platform-samples h2 {
    font-size: 16px;
    margin-bottom: 10px;
}

.example-image {
    display: block;
    width: 100%;
    height: auto;
}

.example-figure-xl {
    width: min(520px, 100%);
    justify-self: end;
}

.image-credit {
    margin-top: -8px;
    text-align: right;
    font-size: 13px;
}

.image-credit a {
    color: #35556f;
    text-decoration: none;
    border-bottom: 1px solid #b7cada;
}

.image-credit a:hover {
    color: #203a50;
    border-bottom-color: #203a50;
}

.image-fallback {
    display: none;
    color: #4f6478;
    font-size: 14px;
    padding: 14px;
}

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

.sample-link {
    display: inline-flex;
    align-items: center;
    justify-content: flex-start;
    gap: 8px;
    min-height: 44px;
    padding: 0 12px;
    border-radius: 11px;
    border: 1px solid #ffd3b6;
    background: #fff5ee;
    color: #8a3f1d;
    text-decoration: none;
    font-weight: 700;
    font-size: 14px;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.sample-link:hover {
    transform: translateY(-1px);
    background: #ffe9db;
}

.sample-icon {
    width: 18px;
    height: 18px;
    border-radius: 4px;
    object-fit: cover;
    flex-shrink: 0;
}

.coming-soon {
    background: #f7fbff;
    border: 1px dashed #c8dcec;
    color: #30465c;
    border-radius: 12px;
    padding: 22px;
    text-align: center;
    font-size: 17px;
    font-weight: 700;
}

.form-group {
    margin-bottom: 20px;
}

label {
    display: block;
    font-weight: 700;
    margin-bottom: 8px;
    font-size: 15px;
}

legend {
    font-weight: 700;
    margin-bottom: 10px;
    font-size: 15px;
    color: #27384a;
}

.platform-fieldset {
    border: 0;
    padding: 0;
    min-width: 0;
}

.radio-group {
    display: flex;
    gap: 12px;
    flex-wrap: wrap;
}

.quick-links {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 10px;
    margin: 6px 0 22px;
}

.quick-link-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
    padding: 8px 12px;
    border-radius: 11px;
    text-decoration: none;
    font-size: 14px;
    font-weight: 700;
    color: #264055;
    background: #eef5fb;
    border: 1px solid #cfe0ef;
    transition: transform 0.15s ease, background-color 0.2s ease;
}

.quick-link-btn:hover {
    transform: translateY(-1px);
    background: #e4f0fa;
}

.radio-option {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1 1 140px;
    min-width: 0;
    padding: 12px 13px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--card-strong);
    cursor: pointer;
    transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.radio-option:hover {
    transform: translateY(-1px);
    border-color: #b8ccdd;
}

.radio-option.selected {
    border-color: var(--brand);
    box-shadow: 0 0 0 3px rgba(15, 157, 133, 0.14);
}

.radio-option input {
    margin: 0;
    accent-color: var(--brand);
}

.radio-option label {
    display: flex;
    align-items: center;
    gap: 6px;
    cursor: pointer;
    margin-bottom: 0;
    font-weight: 700;
}

.app-icon {
    width: 20px;
    height: 20px;
    margin-right: 5px;
    border-radius: 5px;
    object-fit: cover;
}

.input-block {
    position: relative;
    margin-bottom: 13px;
    padding: 14px;
    background-color: #f8fbfd;
    border: 1px solid #e2ebf2;
    border-radius: 12px;
}

.input-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.input-header span {
    font-weight: 700;
    font-size: 14px;
    color: #3b4c5f;
}

.delete-btn {
    background-color: #fbe8ea;
    color: var(--danger);
    border: 1px solid #f4c9ce;
    padding: 5px 9px;
    border-radius: 8px;
    font-size: 12px;
    cursor: pointer;
}

.delete-btn:hover {
    background-color: #f9d7dc;
}

textarea {
    width: 100%;
    height: 104px;
    padding: 12px;
    border: 1px solid #d7e3ee;
    border-radius: 10px;
    resize: vertical;
    font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, 'Liberation Mono', monospace;
    font-size: 13px;
    line-height: 1.5;
    background: #fff;
}

textarea[readonly] {
    background-color: #f8fafd;
    height: 84px;
}

textarea:focus-visible,
button:focus-visible,
input[type="radio"]:focus-visible {
    outline: 3px solid rgba(15, 157, 133, 0.3);
    outline-offset: 2px;
}

.btn-primary,
.btn-secondary,
.btn-copy {
    border: none;
    cursor: pointer;
    border-radius: 11px;
    width: 100%;
    font-weight: 700;
    transition: transform 0.15s ease, filter 0.2s ease;
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-copy:hover {
    transform: translateY(-1px);
    filter: brightness(0.98);
}

.btn-primary {
    background: linear-gradient(120deg, var(--brand) 0%, #16b192 100%);
    color: #fff;
    padding: 13px 20px;
    font-size: 16px;
    margin-top: 10px;
}

.btn-secondary {
    background: linear-gradient(120deg, #51667d 0%, #405062 100%);
    color: #fff;
    padding: 11px 20px;
    font-size: 14px;
    margin-bottom: 10px;
}

.output-group {
    margin-top: 30px;
    border-top: 1px dashed #cad8e5;
    padding-top: 18px;
}

.output-block {
    margin-bottom: 20px;
}

.btn-copy {
    background: linear-gradient(120deg, #2d9c52 0%, var(--success) 100%);
    color: #fff;
    padding: 10px;
    font-size: 14px;
    margin-top: 8px;
}

.warning-text {
    color: #b73f1d;
    font-size: 12px;
    font-weight: 600;
    margin-left: 8px;
    word-break: keep-all;
}

.error-message {
    background-color: #fff2eb;
    color: #7f3016;
    border: 1px solid #f7c9b3;
    padding: 14px;
    border-radius: 10px;
    text-align: center;
    font-weight: 700;
    font-size: 14px;
}

@keyframes rise-in {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@media (max-width: 640px) {
    body {
        padding: 16px 12px;
    }

    .panel {
        padding: 18px;
        border-radius: 18px;
    }

    .radio-option {
        flex-basis: 100%;
    }

    .quick-links {
        grid-template-columns: 1fr;
    }

    .subpage-nav,
    .sample-grid {
        grid-template-columns: 1fr;
    }

    .examples-layout {
        grid-template-columns: 1fr;
    }

    .example-figure-xl {
        width: 100%;
    }

    .image-credit {
        margin-top: -2px;
        text-align: left;
    }

    h1 {
        font-size: 24px;
    }
}
