:root {
    color-scheme: light;
    --ink: #222b23;
    --muted: #525d51;
    --paper: #f6f5ee;
    --card: #fffefa;
    --line: #dcdfd1;
    --field: #284976;
    --green: #284e37;
    --deep-green: #162e21;
    --pale: #e7eee1;
    --brown: #e9d2a5;
    font-family: -apple-system, BlinkMacSystemFont, "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;
    color: var(--ink);
    background: var(--paper);
}
* { box-sizing: border-box; }
body { margin: 0; font-size: 16px; line-height: 1.55; }
a { color: var(--green); }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(2rem, 5vw, 3.15rem); line-height: 1.18; letter-spacing: -.055em; }
h2 { font-size: 1.3rem; line-height: 1.35; letter-spacing: -.025em; }
button, input, textarea, select { font: inherit; }
button, summary { cursor: pointer; }
.wrap { width: min(1120px, calc(100% - 48px)); margin-inline: auto; }
main.wrap { padding-block: 34px 64px; }
main.narrow { max-width: 640px; }
.topbar { background: var(--card); border-bottom: 1px solid var(--line); }
.topbar-inner { min-height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 14px; }
.brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); font-weight: 800; line-height: 1.15; text-decoration: none; }
.brand-mark { width: 37px; height: 37px; display: grid; place-items: center; border-radius: 11px; background: var(--green); color: white; font: bold 22px Georgia, serif; }
.brand small { display: block; margin-top: 3px; color: var(--muted); font-size: .65rem; letter-spacing: .11em; }
nav { display: flex; align-items: center; gap: clamp(12px, 2vw, 26px); }
nav a, .plain { display: inline-block; padding: 11px 0; color: var(--muted); border: 0; background: transparent; font-size: .9rem; font-weight: 700; text-decoration: none; white-space: nowrap; }
nav a:hover, .plain:hover, .back:hover { color: var(--green); text-decoration: underline; }
.hero {
    min-height: 260px;
    display: flex;
    align-items: end;
    color: #fffefa;
    background: linear-gradient(90deg, var(--deep-green) 22%, rgba(22,46,33,.92) 45%, rgba(22,46,33,.17) 100%), url("potatoes.webp") right center / auto 173% no-repeat var(--deep-green);
    border-radius: 20px;
}
.hero-content { padding: clamp(24px, 5vw, 54px); }
.hero-content p:last-child { margin-top: 12px; color: #e3ebdf; }
.eyebrow { margin-bottom: 8px; color: var(--green); font-size: .8rem; font-weight: 800; letter-spacing: .045em; }
.hero .eyebrow { color: var(--brown); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1px; margin: 20px 0 34px; overflow: hidden; border: 1px solid var(--line); border-radius: 15px; background: var(--line); }
.stats div { padding: 18px 22px; background: var(--card); }
.stats span, .muted { color: var(--muted); }
.stats span { display: block; font-size: .88rem; }
.stats strong { display: block; font-size: 1.9rem; line-height: 1.25; color: var(--green); font-variant-numeric: tabular-nums; }
.section-head { margin: 28px 0 13px; display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.plot-grid, .stage-grid, .admin-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.admin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); align-items: start; }
.plot-card, .stage, .panel, .empty, .work-list li, .close-cycle { padding: clamp(17px, 2.5vw, 24px); border: 1px solid var(--line); border-radius: 15px; background: var(--card); overflow-wrap: anywhere; }
.plot-card { display: flex; flex-direction: column; color: var(--ink); text-decoration: none; }
.plot-card:hover { border-color: var(--green); }
.plot-meta { display: block; color: var(--muted); font-size: .86rem; }
.plot-name { display: block; margin-block: 4px; font-size: 1.23rem; font-weight: 800; letter-spacing: -.03em; }
.progress-row { display: flex; align-items: center; gap: 12px; margin-block: 16px 10px; color: var(--green); font-size: .84rem; font-weight: 700; }
.progress-row span { white-space: nowrap; }
progress { appearance: none; width: 100%; height: 8px; border: 0; border-radius: 99px; background-color: var(--pale); color: var(--green); }
progress::-webkit-progress-bar { border-radius: 99px; background: var(--pale); }
progress::-webkit-progress-value { border-radius: 99px; background: var(--green); }
progress::-moz-progress-bar { border-radius: 99px; background: var(--green); }
.plot-totals { display: flex; flex-wrap: wrap; gap: 6px 17px; color: var(--muted); font-size: .84rem; }
.plot-totals b { color: var(--ink); }
.card-link { margin-top: auto; padding-top: 15px; display: flex; align-items: center; justify-content: space-between; color: var(--green); font-size: .9rem; font-weight: 800; }
.button { display: inline-flex; min-height: 44px; padding: 9px 16px; justify-content: center; align-items: center; border: 1px solid transparent; border-radius: 9px; background: var(--green); color: white; font-weight: 750; text-decoration: none; }
.button:hover { background: var(--deep-green); color: white; }
.button.secondary { background: var(--pale); color: var(--green); }
.button.secondary:hover { border-color: var(--green); }
.button:disabled { opacity: .57; cursor: default; }
:focus-visible { outline: 3px solid var(--field); outline-offset: 3px; }
.back { display: inline-block; padding-block: 6px; font-weight: 700; text-decoration: none; }
.page-head { margin-block: 15px 22px; }
.page-head .muted { margin-top: 9px; }
.stage { display: flex; flex-direction: column; align-items: start; gap: 8px; }
.stage h3 { font-size: 1.18rem; }
.stage p { flex: 1; margin-bottom: 8px; color: var(--muted); font-size: .9rem; }
.stage .button { width: 100%; }
.pill { display: inline-block; padding: 3px 9px; border-radius: 50px; color: #58411f; background: #f5ead7; font-size: .76rem; font-weight: 750; }
.pill.done { background: var(--pale); color: var(--green); }
.work-list { display: grid; gap: 8px; margin: 0; padding: 0; list-style: none; }
.work-heading { display: flex; justify-content: space-between; gap: 10px; }
.work-heading time, .entry-source { font-size: .82rem; color: var(--muted); }
.work-list p { margin-top: 5px; }
.work-list .entry-source:empty { display: none; }
.work-note { white-space: pre-wrap; }
.history-picker { display: flex; gap: 8px; align-items: end; width: min(100%, 400px); }
.history-picker label { flex: 1; }
.stack { display: grid; gap: 15px; }
.panel h2 { margin-bottom: 12px; }
label { display: block; color: var(--ink); font-size: .91rem; font-weight: 700; }
label small { display: block; margin-top: 4px; }
input, select, textarea { display: block; width: 100%; min-width: 0; min-height: 45px; margin-top: 4px; padding: 9px 11px; border: 1px solid #abb3a6; border-radius: 8px; background: #fff; color: var(--ink); font-size: 1rem; font-weight: 500; }
textarea { resize: vertical; }
.messages { display: grid; gap: 8px; margin-block: 14px; }
.notice { padding: 10px 13px; border-radius: 8px; }
.success { color: #214632; background: var(--pale); }
.error { color: #80251e; background: #fae5df; }
.compact-list { margin: 13px 0 0; padding: 9px 9px 0 24px; border-top: 1px solid var(--line); font-size: .88rem; }
.close-cycle { margin-top: 25px; }
.close-cycle form { margin-top: 12px; max-width: 400px; }
.close-cycle summary { color: var(--green); font-weight: 750; }
.login-layout { display: grid; grid-template-columns: 1.15fr 1fr; align-items: stretch; min-height: 530px; }
.login-photo { border-radius: 18px 0 0 18px; background: url("potatoes.webp") 51% 54% / cover; }
.login-box { display: grid; align-content: center; gap: 13px; padding: clamp(26px, 5vw, 58px); border: 1px solid var(--line); background: var(--card); border-radius: 0 18px 18px 0; }
.login-box form { margin-top: 10px; }
@media (max-width: 790px) {
    .plot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 600px) {
    .wrap { width: calc(100% - 28px); }
    main.wrap { padding-block: 20px 44px; }
    .topbar-inner { min-height: 60px; flex-wrap: wrap; }
    nav a, .plain { font-size: .83rem; }
    .hero { min-height: 215px; background-size: auto, auto 120%; background-position: center, 75% center; border-radius: 15px; }
    .hero-content p:last-child { max-width: 25ch; font-size: .92rem; }
    .stats { margin-block: 12px 25px; }
    .stats div { padding: 10px 9px; }
    .stats span { font-size: .77rem; }
    .stats strong { font-size: 1.45rem; }
    .plot-grid, .stage-grid, .admin-grid, .login-layout { grid-template-columns: 1fr; }
    .stage { gap: 6px; }
    .login-photo { height: 135px; border-radius: 14px 14px 0 0; }
    .login-box { border-radius: 0 0 14px 14px; }
}
@media (max-width: 355px) {
    .topbar-inner { gap: 2px; }
    nav { width: 100%; justify-content: space-between; }
}
