:root {
    --ink: #18211c;
    --muted: #66716a;
    --paper: #f7f5ee;
    --card: #fffdf8;
    --line: #dddcd3;
    --green: #176b4d;
    --green-dark: #0f5139;
    --green-soft: #dcecdf;
    --orange: #e86f3a;
    --danger: #b42318;
    --shadow: 0 18px 50px rgba(25, 43, 32, .09);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: Pretendard, "Noto Sans KR", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; line-height: 1.65; }
a { color: inherit; }
button, input, textarea { font: inherit; }
.shell { width: min(1120px, calc(100% - 40px)); margin-inline: auto; }
.skip-link { position: fixed; top: -100px; left: 16px; z-index: 100; background: var(--ink); color: white; padding: 10px 16px; }
.skip-link:focus { top: 16px; }
.site-header { background: rgba(247,245,238,.92); border-bottom: 1px solid rgba(24,33,28,.1); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); }
.nav-wrap { height: 72px; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 800; letter-spacing: -.02em; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px; background: var(--green); color: white; }
.main-nav { display: flex; align-items: center; gap: 20px; font-size: .94rem; }
.main-nav a { text-decoration: none; }
.main-nav form { margin: 0; }
.nav-logout { border: 0; background: none; color: var(--muted); cursor: pointer; padding: 8px 0; }
.page-content { min-height: calc(100vh - 190px); padding-block: 58px 90px; }
.button { display: inline-flex; justify-content: center; align-items: center; border: 1px solid var(--green); border-radius: 12px; background: var(--green); color: white; padding: 12px 20px; font-weight: 750; text-decoration: none; cursor: pointer; transition: transform .15s, background .15s; }
.button:hover { background: var(--green-dark); transform: translateY(-1px); }
.button:focus-visible, a:focus-visible, input:focus-visible, textarea:focus-visible, button:focus-visible { outline: 3px solid rgba(232,111,58,.35); outline-offset: 2px; }
.button-secondary { background: transparent; color: var(--green); }
.button-secondary:hover { color: white; }
.button-small { padding: 8px 14px; border-radius: 9px; }
.button-full { width: 100%; margin-top: 8px; }
.text-link, .back-link { color: var(--green); font-weight: 750; text-decoration: none; }
.eyebrow { display: inline-block; color: var(--orange); font-size: .78rem; font-weight: 850; letter-spacing: .12em; text-transform: uppercase; margin-bottom: 12px; }
.muted { color: var(--muted); }
.hero { display: grid; grid-template-columns: 1.25fr .75fr; gap: 64px; align-items: center; padding: 44px 0 86px; }
.hero h1, .auth-intro h1 { font-size: clamp(2.5rem, 5vw, 4.7rem); line-height: 1.08; letter-spacing: -.055em; margin: 0 0 26px; }
.hero-copy > p { max-width: 610px; color: var(--muted); font-size: 1.1rem; }
.hero-actions { display: flex; gap: 22px; align-items: center; margin-top: 34px; }
.hero-card { background: var(--green); color: white; padding: 38px; border-radius: 28px; box-shadow: var(--shadow); transform: rotate(1.5deg); }
.hero-card h2 { margin: 15px 0 8px; font-size: 1.5rem; }
.hero-card p { color: rgba(255,255,255,.78); }
.feature-icon { width: 46px; height: 46px; display: grid; place-items: center; background: var(--orange); border-radius: 50%; font-weight: 900; }
.mini-stats { margin: 30px 0 0; border-top: 1px solid rgba(255,255,255,.2); }
.mini-stats div { display: flex; justify-content: space-between; padding: 12px 0; border-bottom: 1px solid rgba(255,255,255,.13); }
.mini-stats dt { color: rgba(255,255,255,.65); }
.mini-stats dd { margin: 0; font-weight: 700; }
.section-block { padding-top: 64px; border-top: 1px solid var(--line); }
.section-heading h2 { font-size: 2.1rem; letter-spacing: -.04em; margin: 0; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 34px; }
.feature-card { padding: 28px; background: rgba(255,255,255,.45); border: 1px solid var(--line); border-radius: 18px; }
.feature-card > span { color: var(--orange); font-weight: 900; font-size: .85rem; }
.feature-card h3 { margin: 22px 0 6px; }
.feature-card p { margin: 0; color: var(--muted); }
.auth-layout { display: grid; grid-template-columns: 1fr minmax(380px, 500px); gap: 80px; align-items: start; }
.auth-layout-compact { align-items: center; min-height: 600px; }
.auth-intro { padding-top: 40px; }
.auth-intro h1 { font-size: clamp(2.5rem, 4.6vw, 4.2rem); }
.auth-intro > p { color: var(--muted); max-width: 540px; font-size: 1.05rem; }
.security-notes { list-style: none; margin: 32px 0; padding: 0; }
.security-notes li { padding: 10px 0 10px 30px; position: relative; }
.security-notes li::before { content: "✓"; position: absolute; left: 0; color: var(--green); font-weight: 900; }
.form-card, .settings-card, .profile-card, .privacy-card { background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.form-card { padding: clamp(28px, 5vw, 48px); }
.form-card h1, .form-card h2 { margin: 0; letter-spacing: -.035em; }
.form-card h2 { font-size: 2rem; }
.form-lead { color: var(--muted); margin: 8px 0 28px; }
.field-group { margin: 0 0 20px; }
.field-group label { display: block; font-size: .91rem; font-weight: 750; margin-bottom: 7px; }
.form-control { width: 100%; min-height: 48px; padding: 11px 13px; color: var(--ink); background: white; border: 1px solid #c9cbc5; border-radius: 10px; }
textarea.form-control { resize: vertical; }
.form-control:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(23,107,77,.1); outline: none; }
.help-text { color: var(--muted); font-size: .8rem; margin-top: 6px; }
.help-text ul { margin: 6px 0 0; padding-left: 20px; }
.error-text { color: var(--danger); font-size: .84rem; margin: 6px 0 0; }
.field-error .form-control { border-color: var(--danger); }
.form-alert { color: var(--danger); background: #fff0ee; border: 1px solid #f6c7c2; border-radius: 10px; padding: 11px 14px; margin-bottom: 20px; }
.form-alert p { margin: 0; }
.form-foot { text-align: center; color: var(--muted); margin: 24px 0 0; }
.form-foot a { color: var(--green); font-weight: 750; }
.messages { padding-top: 18px; }
.message { border-radius: 10px; padding: 12px 16px; background: #edf5ee; border: 1px solid #bfd9c4; }
.message-error { background: #fff0ee; border-color: #f6c7c2; }
.profile-shell { max-width: 850px; margin-inline: auto; }
.profile-card { display: grid; grid-template-columns: 120px 1fr; gap: 34px; padding: 44px; }
.avatar { width: 120px; height: 120px; display: grid; place-items: center; border-radius: 32px; background: var(--green-soft); color: var(--green); font-size: 3rem; font-weight: 900; }
.profile-main h1 { font-size: 2.5rem; margin: 0; letter-spacing: -.045em; }
.joined { color: var(--muted); margin-top: 2px; }
.introduction { min-height: 80px; margin: 26px 0; font-size: 1.05rem; }
.privacy-card { margin-top: 18px; padding: 22px 26px; box-shadow: none; background: transparent; }
.privacy-card p { color: var(--muted); margin: 5px 0 0; }
.dashboard-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 38px; }
.dashboard-heading h1 { font-size: 2.6rem; letter-spacing: -.045em; margin: 0; }
.dashboard-heading p { color: var(--muted); margin: 8px 0 0; }
.settings-grid { display: grid; grid-template-columns: 1.08fr .92fr; gap: 24px; }
.settings-card { padding: 34px; }
.card-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 28px; }
.card-heading h2 { display: inline; margin: 0 0 0 9px; font-size: 1.4rem; }
.card-number { color: var(--orange); font-size: .78rem; font-weight: 900; }
.status-pill { background: #ecece6; color: var(--muted); border-radius: 999px; padding: 5px 10px; font-size: .75rem; font-weight: 800; }
.status-safe { background: var(--green-soft); color: var(--green); }
.account-info { border-block: 1px solid var(--line); margin: 0 0 26px; }
.account-info div { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.account-info div:last-child { border: 0; }
.account-info dt { color: var(--muted); }
.account-info dd { margin: 0; font-weight: 700; }
.security-card > p { color: var(--muted); }
.security-list { list-style: none; padding: 0; margin: 26px 0; border-block: 1px solid var(--line); }
.security-list li { display: flex; justify-content: space-between; padding: 13px 0; border-bottom: 1px solid var(--line); }
.security-list li:last-child { border: 0; }
.security-list span { color: var(--muted); }
.narrow-page { max-width: 560px; margin-inline: auto; }
.narrow-page .back-link { display: inline-block; margin-bottom: 20px; }
.error-page { text-align: center; max-width: 650px; margin: 80px auto; }
.error-code { color: var(--orange); font-size: 1rem; font-weight: 900; letter-spacing: .15em; }
.error-page h1 { font-size: 2.6rem; letter-spacing: -.04em; }
.error-page p { color: var(--muted); margin-bottom: 30px; }
.site-footer { border-top: 1px solid var(--line); padding: 32px 0; }
.footer-content { display: flex; justify-content: space-between; gap: 20px; font-size: .86rem; }
.footer-content p { margin: 0; }
.catalog-heading { display: flex; justify-content: space-between; align-items: end; gap: 30px; margin-bottom: 42px; }
.catalog-heading h1 { font-size: clamp(2.4rem, 5vw, 4rem); letter-spacing: -.055em; line-height: 1.08; margin: 0; }
.catalog-heading p { color: var(--muted); margin: 12px 0 0; }
.product-name-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ink); }
.product-name-list li { border-bottom: 1px solid var(--line); }
.product-name-list a { display: grid; grid-template-columns: 55px 1fr 30px; gap: 12px; align-items: center; min-height: 82px; text-decoration: none; transition: padding .18s, background .18s; }
.product-name-list a:hover { background: rgba(255,255,255,.5); padding-inline: 14px; }
.product-index { color: var(--orange); font-size: .76rem; font-weight: 900; }
.product-name-list strong { font-size: 1.16rem; }
.product-arrow { color: var(--green); font-size: 1.3rem; }
.pagination { display: grid; grid-template-columns: 1fr auto 1fr; gap: 20px; align-items: center; margin-top: 30px; color: var(--muted); font-size: .9rem; }
.pagination a { color: var(--green); font-weight: 750; text-decoration: none; }
.pagination a:last-child { text-align: right; }
.empty-state { text-align: center; border: 1px dashed #b8bbb4; border-radius: 24px; padding: 70px 24px; }
.empty-state > span { display: block; color: var(--orange); font-size: 3rem; line-height: 1; }
.empty-state h2 { margin: 18px 0 4px; }
.empty-state p { color: var(--muted); margin: 0 0 24px; }
.product-detail { display: grid; grid-template-columns: minmax(0, 1.05fr) minmax(340px, .95fr); gap: 56px; align-items: start; margin-top: 24px; }
.product-image-frame { aspect-ratio: 1; overflow: hidden; border-radius: 26px; background: #eceae2; border: 1px solid var(--line); }
.product-image-frame img { width: 100%; height: 100%; display: block; object-fit: cover; }
.product-detail-copy { padding-top: 18px; }
.product-detail-copy h1 { font-size: clamp(2.3rem, 4vw, 3.8rem); letter-spacing: -.055em; line-height: 1.1; margin: 0; }
.product-price { color: var(--green); font-size: 1.8rem; font-weight: 850; margin: 16px 0 30px; }
.seller-line { display: flex; align-items: center; gap: 12px; padding-block: 20px; border-block: 1px solid var(--line); }
.mini-avatar { display: grid; place-items: center; width: 42px; height: 42px; border-radius: 13px; background: var(--green-soft); color: var(--green); font-weight: 900; }
.seller-line span { display: block; color: var(--muted); font-size: .76rem; }
.seller-line a { font-weight: 800; text-decoration: none; }
.product-description { margin-top: 30px; }
.product-description h2 { font-size: 1rem; margin: 0 0 10px; }
.product-description p { color: #3e4842; white-space: normal; }
.product-date { color: var(--muted); font-size: .78rem; margin-top: 32px; }
.owner-actions { display: flex; align-items: center; gap: 18px; margin-top: 24px; }
.danger-link { color: var(--danger); font-weight: 750; text-decoration: none; }
.button-danger { background: var(--danger); border-color: var(--danger); }
.button-danger:hover { background: #8f1c14; }
.product-form-layout { display: grid; grid-template-columns: 1fr minmax(420px, 560px); gap: 70px; align-items: start; }
.product-form-intro h1 { font-size: clamp(2.5rem, 4.6vw, 4rem); }
.current-image { margin-bottom: 24px; }
.current-image span { display: block; color: var(--muted); font-size: .82rem; font-weight: 750; margin-bottom: 8px; }
.current-image img { width: 100%; max-height: 220px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
input[type="file"].form-control { padding: 10px; background: #faf9f4; }
.my-product-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 22px; }
.my-product-card { display: grid; grid-template-columns: 170px 1fr; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 20px; }
.my-product-image { min-height: 190px; background: #eceae2; }
.my-product-image img { width: 100%; height: 100%; display: block; object-fit: cover; }
.my-product-copy { padding: 24px; }
.my-product-copy h2 { font-size: 1.18rem; margin: 16px 0 2px; }
.my-product-copy h2 a { text-decoration: none; }
.product-price-small { color: var(--green); font-weight: 850; margin: 0; }
.card-actions { display: flex; gap: 16px; margin-top: 22px; font-size: .88rem; }
.card-actions a { font-weight: 750; text-decoration: none; }
.delete-card p { color: var(--muted); margin-bottom: 28px; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
.chat-hub-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 24px; }
.user-list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--line); }
.user-list li { border-bottom: 1px solid var(--line); }
.user-list a { display: grid; grid-template-columns: 42px 1fr auto; gap: 12px; align-items: center; padding: 14px 0; text-decoration: none; }
.user-list a:hover strong { color: var(--green); }
.chat-page { max-width: 900px; margin-inline: auto; }
.chat-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 24px; }
.chat-heading .back-link { display: block; margin-bottom: 28px; }
.chat-heading .eyebrow { display: block; }
.chat-heading h1 { font-size: clamp(2.2rem, 5vw, 3.5rem); line-height: 1.1; letter-spacing: -.05em; margin: 0; }
.chat-heading p { color: var(--muted); margin: 8px 0 0; }
.chat-status { flex: 0 0 auto; color: var(--muted); background: #e9e9e3; border-radius: 999px; padding: 6px 11px; font-size: .78rem; font-weight: 800; }
.chat-status-online { color: var(--green); background: var(--green-soft); }
.chat-panel { overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: 22px; box-shadow: var(--shadow); }
.chat-messages { height: min(58vh, 600px); min-height: 380px; overflow-y: auto; padding: 28px; display: flex; flex-direction: column; gap: 14px; }
.chat-message { align-self: flex-start; max-width: min(75%, 620px); }
.chat-message-meta { display: flex; gap: 8px; align-items: baseline; margin: 0 5px 4px; font-size: .76rem; }
.chat-message-meta time { color: var(--muted); }
.chat-message p { margin: 0; padding: 11px 15px; border-radius: 7px 17px 17px 17px; background: #ecece6; white-space: pre-wrap; overflow-wrap: anywhere; }
.chat-message-own { align-self: flex-end; }
.chat-message-own .chat-message-meta { justify-content: flex-end; }
.chat-message-own p { color: white; background: var(--green); border-radius: 17px 7px 17px 17px; }
.chat-empty { margin: auto; text-align: center; color: var(--muted); }
.chat-empty span { color: var(--orange); font-weight: 900; letter-spacing: .2em; }
.chat-compose { display: grid; grid-template-columns: 1fr auto; gap: 12px; padding: 18px; border-top: 1px solid var(--line); background: #faf9f4; }
.chat-compose textarea { width: 100%; resize: none; border: 1px solid #c9cbc5; border-radius: 12px; padding: 11px 13px; }
.chat-compose textarea:disabled { background: #ecece6; }
.chat-error { min-height: 24px; color: var(--danger); background: #faf9f4; font-size: .82rem; margin: 0; padding: 0 18px 10px; }
.settings-inline-link { display: block; margin-top: 20px; }
.report-layout { display: grid; grid-template-columns: 1fr minmax(400px, 540px); gap: 70px; align-items: start; }
.report-layout .form-card h2 { margin-top: 16px; }
.report-list { display: grid; gap: 16px; }
.report-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; }
.report-card-heading { display: flex; justify-content: space-between; gap: 20px; align-items: start; }
.report-card .eyebrow { margin-bottom: 3px; }
.report-card h2 { font-size: 1.25rem; margin: 0; }
.report-card p { white-space: pre-wrap; overflow-wrap: anywhere; }
.report-card time { color: var(--muted); font-size: .8rem; }
.status-alert { color: var(--danger); background: #fff0ee; }
.search-bar { display: grid; grid-template-columns: minmax(0, 1fr) 180px auto; gap: 12px; margin-bottom: 32px; }
.search-bar-compact { grid-template-columns: minmax(0, 1fr) auto; }
.search-bar > div:first-child .form-control { width: 100%; }
.search-bar select { width: 100%; height: 100%; border: 1px solid #c9cbc5; border-radius: 12px; padding: 10px; background: #faf9f4; }
.search-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.search-card { overflow: hidden; color: inherit; text-decoration: none; background: var(--card); border: 1px solid var(--line); border-radius: 18px; }
.search-card-image { aspect-ratio: 4 / 3; background: #eceae2; }
.search-card-image img { width: 100%; height: 100%; object-fit: cover; }
.search-card > div:last-child { padding: 18px; }
.search-card h2 { margin: 0 0 4px; font-size: 1.05rem; }
.search-card p { color: var(--green); font-weight: 850; margin: 0; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 36px; padding: 10px; border: 1px solid var(--line); border-radius: 14px; background: var(--card); }
.admin-nav a { padding: 8px 12px; font-weight: 750; text-decoration: none; }
.admin-stats { display: grid; grid-template-columns: repeat(5, 1fr); gap: 12px; margin-bottom: 40px; }
.admin-stats div { padding: 20px; border: 1px solid var(--line); border-radius: 16px; background: var(--card); color: var(--muted); }
.admin-stats strong { display: block; color: var(--ink); font-size: 2rem; }
.admin-table-wrap { overflow-x: auto; }
.admin-table { width: 100%; border-collapse: collapse; background: var(--card); }
.admin-table th, .admin-table td { padding: 13px; border-bottom: 1px solid var(--line); text-align: left; vertical-align: top; }
.admin-table th { font-size: .78rem; color: var(--muted); }
.admin-table form { display: inline; }
.admin-table button { border: 1px solid var(--line); border-radius: 8px; padding: 5px 8px; background: white; cursor: pointer; }
.inline-actions { display: flex; flex-wrap: wrap; gap: 5px; }
.narrow-card { max-width: 520px; margin-inline: auto; }

@media (max-width: 800px) {
    .shell { width: min(100% - 28px, 680px); }
    .main-nav .nav-wide { display: none; }
    .main-nav { gap: 12px; }
    .hero, .auth-layout, .settings-grid, .product-detail, .product-form-layout, .chat-hub-grid, .report-layout { grid-template-columns: 1fr; gap: 34px; }
    .hero { padding-top: 20px; }
    .hero-card { transform: none; }
    .feature-grid { grid-template-columns: 1fr; }
    .auth-intro { padding-top: 0; }
    .auth-intro h1 { font-size: 2.7rem; }
    .dashboard-heading { display: block; }
    .dashboard-heading .text-link { display: inline-block; margin-top: 18px; }
    .profile-card { grid-template-columns: 1fr; padding: 30px; }
    .avatar { width: 90px; height: 90px; border-radius: 24px; }
    .footer-content { display: block; }
    .catalog-heading { display: block; }
    .catalog-heading .button { margin-top: 22px; }
    .my-product-grid { grid-template-columns: 1fr; }
    .my-product-card { grid-template-columns: 125px 1fr; }
    .my-product-image { min-height: 160px; }
    .chat-heading { display: block; }
    .chat-status { display: inline-block; margin-top: 14px; }
    .chat-messages { height: 55vh; padding: 18px; }
    .search-bar, .search-grid { grid-template-columns: 1fr; }
    .admin-stats { grid-template-columns: repeat(2, 1fr); }
    .chat-message { max-width: 88%; }
}
