:root {
    --ry-primary: #1769e0;
    --ry-primary-soft: #eef5ff;
    --ry-text: #172033;
    --ry-muted: #687386;
    --ry-border: #e3e8f0;
    --ry-bg: #f5f7fb;
    --ry-card: #fff;
    --ry-danger: #b42318;
    --ry-warn: #9a6700;
    --ry-shadow: 0 8px 24px rgba(30,49,84,.08);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body {
    margin: 0;
    min-height: 100vh;
    background: var(--ry-bg);
    color: var(--ry-text);
    font-family: 'Noto Sans KR', system-ui, sans-serif;
}
a { color: inherit; }
button, select { font: inherit; }

.ry-topbar {
    position: sticky;
    top: 0;
    z-index: 50;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 16px;
    min-height: 58px;
    padding: 10px max(20px, calc((100% - 1180px) / 2));
    border-bottom: 1px solid rgba(227,232,240,.95);
    background: rgba(255,255,255,.95);
    backdrop-filter: blur(12px);
}
.ry-topbar a { text-decoration: none; font-weight: 700; }
.ry-topbar a:last-child { justify-self: end; }

.ry-page {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
    padding: 30px 0 60px;
}
.ry-hero {
    padding: 32px;
    border: 1px solid var(--ry-border);
    border-radius: 22px;
    background: linear-gradient(135deg,#fff 0%,#eef5ff 100%);
    box-shadow: var(--ry-shadow);
}
.ry-kicker { margin: 0 0 7px; color: var(--ry-primary); font-size: 13px; font-weight: 800; }
.ry-hero h1 { margin: 0; font-size: clamp(28px,4vw,44px); letter-spacing: -.04em; }
.ry-hero > p:not(.ry-kicker) { max-width: 820px; margin: 14px 0 0; color: var(--ry-muted); line-height: 1.7; }
.ry-status {
    display: inline-flex;
    margin-top: 18px;
    padding: 8px 12px;
    border-radius: 999px;
    background: rgba(23,105,224,.09);
    color: #1454b5;
    font-size: 12px;
    font-weight: 800;
}

.ry-controls {
    display: grid;
    grid-template-columns: 1.1fr 1.1fr 1fr auto;
    gap: 12px;
    margin: 18px 0;
    padding: 18px;
    border: 1px solid var(--ry-border);
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 4px 14px rgba(30,49,84,.05);
}
.ry-controls label { display: flex; flex-direction: column; gap: 7px; }
.ry-controls label span { color: var(--ry-muted); font-size: 12px; font-weight: 700; }
.ry-controls select, .ry-controls button { min-height: 44px; border-radius: 10px; }
.ry-controls select { width: 100%; padding: 9px 12px; border: 1px solid var(--ry-border); background: #fff; }
.ry-controls button {
    align-self: end;
    min-width: 110px;
    padding: 10px 18px;
    border: 1px solid var(--ry-primary);
    background: var(--ry-primary);
    color: #fff;
    font-weight: 800;
    cursor: pointer;
}

.ry-summary {
    display: grid;
    grid-template-columns: repeat(4,minmax(0,1fr));
    gap: 12px;
    margin-bottom: 18px;
}
.ry-summary > div { padding: 18px; border: 1px solid var(--ry-border); border-radius: 14px; background: #fff; }
.ry-summary span { display: block; margin-bottom: 7px; color: var(--ry-muted); font-size: 12px; }
.ry-summary strong { font-size: 18px; }

.ry-card, .ry-method {
    margin-bottom: 18px;
    padding: 26px;
    border: 1px solid var(--ry-border);
    border-radius: 18px;
    background: var(--ry-card);
    box-shadow: var(--ry-shadow);
}
.ry-heading { display: flex; align-items: end; justify-content: space-between; gap: 18px; margin-bottom: 18px; }
.ry-heading h2, .ry-method h2 { margin: 0; font-size: 22px; letter-spacing: -.03em; }
.ry-help { margin: 0; color: var(--ry-muted); font-size: 12px; }
.ry-message { min-height: 120px; display: flex; align-items: center; justify-content: center; color: var(--ry-muted); text-align: center; }
.ry-error { color: var(--ry-danger); }

.ry-table-wrap { width: 100%; overflow-x: auto; }
.ry-table { width: 100%; min-width: 1150px; border-collapse: collapse; }
.ry-table th {
    padding: 12px 10px;
    border-top: 1px solid var(--ry-border);
    border-bottom: 1px solid var(--ry-border);
    background: #f8fafc;
    color: var(--ry-muted);
    font-size: 12px;
    text-align: left;
}
.ry-table td { padding: 15px 10px; border-bottom: 1px solid #edf0f5; font-size: 13px; vertical-align: middle; }
.ry-table tbody tr { cursor: pointer; }
.ry-table tbody tr:hover { background: #fafcff; }
.ry-rank { width: 42px; color: var(--ry-muted); font-weight: 800; }
.ry-apt strong { display: block; font-size: 14px; }
.ry-apt span { display: block; margin-top: 4px; color: var(--ry-muted); font-size: 11px; }
.ry-price { white-space: nowrap; font-weight: 700; }
.ry-yield { white-space: nowrap; color: var(--ry-primary); }
.ry-yield strong { margin-right: 6px; font-size: 14px; }
.ry-sample { color: var(--ry-muted); white-space: nowrap; font-size: 11px; }
.ry-badge { display: inline-flex; align-items: center; padding: 3px 6px; border-radius: 999px; font-size: 10px; font-weight: 800; }
.ry-badge-high { background: #fff4d6; color: var(--ry-warn); }
.ry-badge-alert { background: #ffe9e6; color: var(--ry-danger); }

.ry-mobile-list { display: none; }
.ry-mobile-card { display: block; padding: 17px; border: 1px solid var(--ry-border); border-radius: 14px; background: #fff; text-decoration: none; }
.ry-mobile-head { display: flex; justify-content: space-between; gap: 12px; }
.ry-mobile-head span { color: var(--ry-primary); font-weight: 800; }
.ry-mobile-card > p { margin: 5px 0 13px; color: var(--ry-muted); font-size: 11px; }
.ry-mobile-metrics { display: grid; grid-template-columns: repeat(2,1fr); gap: 8px; }
.ry-mobile-metrics div { padding: 10px; border-radius: 10px; background: #f8fafc; }
.ry-mobile-metrics span { display: block; margin-bottom: 4px; color: var(--ry-muted); font-size: 10px; }
.ry-mobile-metrics strong { font-size: 12px; }
.ry-mobile-sample { margin-top: 10px !important; }

.ry-method h2 { margin-bottom: 10px; }
.ry-method p { margin: 8px 0 0; color: var(--ry-muted); font-size: 13px; line-height: 1.8; }

@media (max-width: 800px) {
    .ry-topbar { padding-inline: 16px; font-size: 13px; }
    .ry-page { width: min(100% - 20px,1180px); padding-top: 16px; }
    .ry-hero { padding: 23px 20px; border-radius: 17px; }
    .ry-controls { grid-template-columns: 1fr 1fr; }
    .ry-controls label:nth-child(3) { grid-column: 1 / 2; }
    .ry-controls button { grid-column: 2 / 3; width: 100%; }
    .ry-summary { grid-template-columns: repeat(2,minmax(0,1fr)); }
    .ry-card, .ry-method { padding: 20px 16px; }
    .ry-heading { align-items: flex-start; flex-direction: column; }
    .ry-table-wrap { display: none !important; }
    .ry-mobile-list { display: grid; gap: 10px; }
}

@media (max-width: 520px) {
    .ry-controls { grid-template-columns: 1fr; }
    .ry-controls label:nth-child(3), .ry-controls button { grid-column: auto; }
    .ry-summary { grid-template-columns: 1fr 1fr; gap: 8px; }
    .ry-summary > div { padding: 14px; }
    .ry-summary strong { font-size: 15px; }
}
