:root {
    color-scheme: light;
    --ink: #172438;
    --muted: #566579;
    --blue: #215be3;
    --line: #dce3ec;
    --surface: #fff;
    font-family: "Pretendard", "Noto Sans KR", "Malgun Gothic", system-ui, sans-serif;
    color: var(--ink);
    background: #f3f6fa;
    font-size: 16px;
    line-height: 1.6;
}
* { box-sizing: border-box; }
body { margin: 0; }
a { color: var(--blue); text-decoration: none; }
a:hover { text-decoration: underline; }
button, input { font: inherit; }
button, .button {
    display: inline-block;
    background: var(--blue);
    color: white;
    border: 1px solid var(--blue);
    border-radius: 9px;
    padding: 12px 24px;
    cursor: pointer;
    font-weight: 650;
    white-space: nowrap;
}
button:hover, .button:hover { filter: brightness(.93); }
:focus-visible { outline: 3px solid #e39418; outline-offset: 3px; }
input {
    min-width: 0;
    border: 1px solid #b9c5d5;
    border-radius: 9px;
    padding: 13px 16px;
    background: white;
    color: var(--ink);
}
label { display: block; font-weight: 650; margin-bottom: 9px; }
h1, h2, p { margin-top: 0; }
h1 { line-height: 1.25; letter-spacing: -.04em; }
h2 { font-size: 1.15rem; margin-bottom: 0; }
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    max-width: 1280px;
    margin: auto;
    padding: 24px 32px;
    border-bottom: 1px solid var(--line);
}
.brand { font-weight: 850; font-size: 1.9rem; letter-spacing: -.06em; color: var(--ink); }
.brand span { color: var(--blue); }
.header nav { display: flex; gap: 28px; font-size: .9rem; }
.header nav a { color: var(--muted); }
.home { max-width: 940px; margin: 70px auto 90px; padding: 0 24px; }
.eyebrow { color: var(--blue); font-size: .8rem; font-weight: 750; letter-spacing: .12em; margin-bottom: 14px; }
.home h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); margin-bottom: 22px; }
.home h1 span { color: var(--blue); }
.lead { color: var(--muted); font-size: 1.1rem; margin-bottom: 36px; }
.card { background: var(--surface); border: 1px solid var(--line); border-radius: 16px; }
.create-card { padding: 32px; box-shadow: 0 15px 40px #17243808; }
.input-row { display: flex; gap: 12px; }
.input-row input { flex: 1; }
.muted { color: var(--muted); font-size: .875rem; }
#url-help { margin: 12px 0 0; }
.result { background: #edf4ff; border-radius: 10px; margin-top: 24px; padding: 22px; }
.result .eyebrow { display: block; }
.result p { margin: 8px 0 0; }
.alert { color: #9d2222; background: #fff0ef; padding: 12px 16px; border-radius: 8px; margin: 16px 0; }
.home-notes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; margin-top: 32px; }
.home-notes p { color: var(--muted); font-size: .875rem; }
.home-notes strong { display: inline-block; color: var(--ink); margin-bottom: 7px; }
.footer { max-width: 1216px; margin: auto; padding: 25px 24px; border-top: 1px solid var(--line); display: flex; justify-content: space-between; gap: 20px; color: var(--muted); font-size: .875rem; }
.login { max-width: 460px; padding: 36px; margin: 80px auto 120px; }
.login h1 { font-size: 2rem; }
.stack { display: flex; flex-direction: column; }
.stack label { margin: 16px 0 8px; }
.stack button { margin-top: 24px; }
.dashboard { max-width: 1280px; margin: 36px auto 60px; padding: 0 32px; }
.page-heading, .section-heading { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.page-heading h1 { font-size: 2rem; margin-bottom: 26px; }
.page-heading .eyebrow { margin-bottom: 6px; }
.page-heading form { display: flex; gap: 14px; align-items: center; }
.secondary { background: #fff; border-color: var(--line); color: var(--ink); padding: 9px 16px; }
.metrics { display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; margin: 4px 0 24px; }
.metric { padding: 22px 26px; }
.metric span { color: var(--muted); font-size: .9rem; }
.metric strong { display: block; font-size: 2.3rem; margin-top: 12px; font-weight: 750; font-variant-numeric: tabular-nums; }
.metric:last-child { background: #172f60; color: white; border-color: #172f60; }
.metric:last-child span { color: #d4e1fc; }
.chart-grid { display: grid; grid-template-columns: 1.7fr 1fr; gap: 24px; margin-bottom: 24px; }
.chart-card { padding: 24px; min-width: 0; }
.bar-chart { display: flex; gap: 8px; align-items: end; margin: 34px 0 18px; }
.bar-item { flex: 1; min-width: 0; text-align: center; }
.bar-item svg { width: 100%; height: 140px; display: block; fill: #3672ed; }
.bar-count, .bar-date { display: block; font-size: .75rem; color: var(--muted); }
.bar-date { margin-top: 9px; }
details { font-size: .875rem; color: var(--muted); }
summary { cursor: pointer; }
.ranking { list-style: none; padding: 0; margin: 16px 0 0; }
.ranking li { display: flex; align-items: center; gap: 13px; padding: 12px 0; border-bottom: 1px solid #edf0f5; }
.ranking li:last-child { border-bottom: 0; }
.ranking li div { flex: 1; min-width: 0; }
.ranking small { display: block; overflow: hidden; text-overflow: ellipsis; color: var(--muted); }
.rank { color: var(--blue); font-size: .875rem; background: #edf4ff; padding: 4px 10px; border-radius: 6px; }
.links-card { padding: 24px; }
.search { display: flex; gap: 8px; }
.search input { font-size: .875rem; padding: 9px 12px; width: 260px; }
.table-scroll { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; margin-top: 20px; font-size: .875rem; text-align: left; }
th { color: var(--muted); font-weight: 500; background: #f6f8fb; }
th, td { padding: 15px 12px; border-bottom: 1px solid var(--line); }
td { white-space: nowrap; }
.url-cell { max-width: 380px; min-width: 220px; }
.url-cell a { font-weight: 650; }
.url-cell small { display: block; color: var(--muted); overflow: hidden; text-overflow: ellipsis; max-width: 380px; margin-top: 5px; }
.badge { border-radius: 20px; background: #edf0f4; color: #536071; padding: 4px 11px; font-size: .8rem; }
.badge.active { background: #e5f5ef; color: #176347; }
.number { font-weight: 700; font-variant-numeric: tabular-nums; }
.compact { font-size: .8rem; padding: 6px 11px; }
.pagination { display: flex; justify-content: center; gap: 24px; padding-top: 22px; font-size: .875rem; }
.empty { text-align: center; color: var(--muted); padding: 35px 12px; white-space: normal; }
.dashboard > .muted { margin-top: 18px; }
@media (max-width: 900px) {
    .chart-grid { grid-template-columns: 1fr; }
    .metrics { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 600px) {
    .header { padding: 18px 20px; }
    .home { margin-top: 40px; }
    .create-card, .chart-card, .links-card { padding: 20px; }
    .input-row, .section-heading, .page-heading { flex-direction: column; align-items: stretch; }
    .home-notes { grid-template-columns: 1fr; gap: 2px; }
    .dashboard { padding: 0 16px; }
    .page-heading form { margin-bottom: 20px; justify-content: space-between; }
    .metric { padding: 16px; }
    .metric strong { font-size: 1.8rem; }
    .search input { width: 100%; }
    .bar-chart { gap: 2px; }
    .bar-date { writing-mode: vertical-rl; margin: 8px auto 0; }
    .login { margin: 40px 16px 70px; padding: 26px; }
    .footer { flex-direction: column; gap: 5px; }
}
