:root {
    color-scheme: light;
    --canvas: #f7f7f2;
    --surface: #fff;
    --ink: #172720;
    --muted: #58685f;
    --line: #dde4dc;
    --forest: #15382e;
    --lime: #d5f281;
    --mint: #eaf3e6;
    --radius: 18px;
    font-family: "Segoe UI", "Malgun Gothic", "Apple SD Gothic Neo", sans-serif;
    font-size: 16px;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; background: var(--canvas); color: var(--ink); line-height: 1.55; }
button, input, select { font: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
    outline: 2px solid #367c57;
    outline-offset: 3px;
}
h1, h2, h3, p { margin-top: 0; }
.sr-only, .skip-link:not(:focus) {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip-path: inset(50%);
    white-space: nowrap;
}
.skip-link:focus { position: absolute; left: 12px; top: 8px; z-index: 4; background: white; padding: 10px 16px; }
.site-header { background: #fafaf6; border-bottom: 1px solid #e6e9e1; }
.header-inner, .site-main, .site-footer { width: min(1140px, calc(100% - 64px)); margin-inline: auto; }
.header-inner { min-height: 72px; display: flex; align-items: center; gap: 45px; }
.brand { display: inline-flex; align-items: center; gap: 8px; font-size: 33px; font-weight: 800; line-height: 1; letter-spacing: -.08em; }
.brand-dot { color: #588247; margin-left: -.14em; }
.brand-mark { width: 29px; height: 29px; display: grid; grid-template-columns: repeat(2, 7px); gap: 3px; place-content: center; background: var(--forest); border-radius: 9px; }
.brand-mark i { border-radius: 6px 6px 2px 6px; background: var(--lime); }
.brand-mark i:nth-child(2) { transform: rotate(90deg); }
.brand-mark i:nth-child(3) { transform: rotate(-90deg); }
.brand-mark i:nth-child(4) { transform: rotate(180deg); }
.site-nav, .account-nav, .action-row { display: flex; align-items: center; gap: 12px; }
.site-nav { gap: 24px; }
.nav-link { font-size: .93rem; font-weight: 650; color: var(--muted); white-space: nowrap; }
.nav-link.current, .nav-link:hover { color: #224b39; }
.nav-link.current { text-decoration: underline; text-underline-offset: .46em; text-decoration-thickness: 2px; }
.account-nav { margin-left: auto; }
.account-name { color: var(--muted); font-size: .86rem; overflow: hidden; text-overflow: ellipsis; max-width: 9em; white-space: nowrap; }
.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    min-height: 44px;
    padding: 9px 17px;
    border: 1px solid transparent;
    border-radius: 9px;
    font-weight: 700;
    line-height: 1.25;
    white-space: nowrap;
}
.button.accent { background: var(--lime); color: #213820; border-color: #b9d379; }
.button.accent:hover { background: #e3f6a6; }
.button.outline { background: var(--surface); color: var(--ink); border-color: #d8dfd5; }
.button.outline:hover { background: #edf2ea; }
.button.small { min-height: 37px; padding: 7px 12px; font-size: .85rem; }
.site-main { min-height: calc(100vh - 178px); padding-block: 31px 54px; }
.search-hero { position: relative; isolation: isolate; overflow: hidden; padding: 47px 50px 38px; border-radius: 24px; background: #15382e; color: #f6fbf2; }
.hero-lines {
    position: absolute;
    z-index: -1;
    inset: 0;
    background: radial-gradient(ellipse at 93% 44%, #4e815326, transparent 62%),
        repeating-radial-gradient(ellipse 230px 140px at 93% 52%, transparent 0 15px, #c6e7a622 17px 18px, transparent 20px 27px);
    mask-image: linear-gradient(100deg, transparent 41%, #000 70%);
}
.hero-content { position: relative; max-width: 630px; }
.search-hero h1 { margin-bottom: 14px; font-size: clamp(2.1rem, 4.3vw, 3.6rem); font-weight: 800; letter-spacing: -.075em; line-height: 1.14; }
.search-hero p { margin-bottom: 24px; color: #d1e1d6; font-size: .98rem; word-break: keep-all; }
.search-form { display: flex; gap: 8px; max-width: 584px; padding: 6px; background: #fcfdf9; border-radius: 13px; }
.search-input { display: flex; align-items: center; flex: 1 1 0; min-width: 0; padding-inline: 12px 3px; gap: 12px; }
.search-input input { min-width: 0; width: 100%; height: 44px; border: 0; border-radius: 4px; background: transparent; color: var(--ink); }
.search-input input::placeholder { color: #5e6c63; }
.search-form .button { padding-inline: 17px; }
.search-icon { width: 15px; height: 15px; position: relative; border: 2px solid #587264; border-radius: 50%; flex: 0 0 auto; }
.search-icon::after { content: ""; width: 7px; height: 2px; background: #587264; position: absolute; left: 10px; top: 11px; transform: rotate(47deg); }
.quick-search { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; margin-top: 15px; color: #c9dcd0; font-size: .79rem; }
.quick-search a { padding: 4px 9px; border: 1px solid #71938173; border-radius: 6px; color: #eef6ef; }
.quick-search a:hover { border-color: #c9e1ca; color: white; }
.hero-market-link { display: inline-block; margin-top: 16px; color: #e0f4a9; font-size: .85rem; font-weight: 700; }
.hero-market-link:hover, .text-link:hover { text-decoration: underline; text-underline-offset: 3px; }
.results-section { margin-top: 35px; }
.results-top { display: flex; justify-content: space-between; align-items: end; gap: 12px; }
.results-top h2, .management-title h1, .form-shell h1 { font-size: clamp(1.8rem, 3vw, 2.55rem); letter-spacing: -.05em; line-height: 1.2; margin: 5px 0 0; overflow-wrap: anywhere; }
.section-label { display: inline-flex; align-items: center; gap: 6px; color: #3c644e; font-size: .79rem; font-weight: 750; }
.status-dot { width: 7px; height: 7px; background: #5b8c56; border-radius: 50%; }
.result-note { color: var(--muted); margin: 10px 0 -3px; font-size: .86rem; }
.model-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.chip { background: var(--surface); border: 1px solid var(--line); border-radius: 7px; padding: 5px 10px; font-size: .85rem; }
.chip.selected, .chip:hover { background: var(--mint); border-color: #c5d7c3; }
.insight-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; margin: 20px 0 26px; }
.insight { border: 1px solid var(--line); border-radius: var(--radius); padding: 17px 21px 19px; background: var(--surface); }
.insight.recommended { background: #ecf4e5; border-color: #d5e4c9; }
.insight-label { display: flex; align-items: center; gap: 8px; color: #405a49; font-weight: 700; font-size: .87rem; }
.insight-icon { display: inline-grid; place-items: center; width: 26px; height: 26px; background: #e6efe5; border-radius: 7px; color: #365c41; }
.recommended .insight-icon { background: #d9eabe; }
.insight strong { display: block; margin: 5px 0 1px; font-size: clamp(1.65rem, 3vw, 2.14rem); letter-spacing: -.05em; font-variant-numeric: tabular-nums; }
.insight strong.unavailable { font-size: 1.25rem; margin-block: 13px 6px; }
.insight p { margin: 0; color: var(--muted); font-size: .82rem; }
.table-toolbar { display: flex; justify-content: space-between; align-items: center; gap: 10px; margin-bottom: 11px; }
.table-toolbar h3 { margin: 0; font-size: 1.24rem; }
.table-toolbar h3 span, .member-panel h2 span { color: #597a62; font-size: .85em; padding-left: 3px; }
.filter-form { display: flex; gap: 7px; align-items: center; flex-wrap: wrap; }
select, .stack-form input, .invite-result input {
    min-width: 0;
    border: 1px solid #cbd6ce;
    border-radius: 9px;
    background: var(--surface);
    color: var(--ink);
    padding: 9px 11px;
}
.filter-form select { min-height: 37px; padding: 5px 8px; font-size: .85rem; }
.offer-table-wrap { overflow: hidden; border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); }
.offer-table { border-collapse: collapse; width: 100%; text-align: left; }
.offer-table th { background: #eff2eb; color: #4c5c53; font-size: .79rem; font-weight: 700; }
.offer-table th, .offer-table td { padding: 12px 19px; }
.offer-table th:last-child, .offer-table td:last-child { text-align: right; }
.offer-table tr + tr td, .offer-table tbody tr:first-child td { border-top: 1px solid #e9ede7; }
.shop-cell { display: flex; align-items: center; gap: 10px; }
.shop-cell > div { min-width: 0; }
.shop-mark { flex: 0 0 34px; height: 34px; display: grid; place-items: center; font-size: .78rem; font-weight: 800; color: #675b43; border-radius: 9px; background: #f1eee4; }
.shop-mark.mint { color: #345c47; background: #e5eee6; }
.shop-name { font-size: .93rem; font-weight: 700; overflow-wrap: anywhere; }
a.shop-name:hover { text-decoration: underline; text-underline-offset: 3px; }
.offer-table small, .member-list small { display: block; color: var(--muted); font-size: .75rem; }
.condition { display: inline-block; padding: 3px 8px; border-radius: 6px; font-size: .75rem; font-weight: 650; white-space: nowrap; }
.condition.new { color: #315c48; background: #e6f1e9; }
.condition.used { color: #705633; background: #f4eddf; }
.rating { font-size: .88rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.rating span { color: #836116; font-size: .82rem; }
.price { font-size: 1rem; font-variant-numeric: tabular-nums; white-space: nowrap; }
.pending-price, .muted { color: var(--muted); font-size: .87rem; }
.site-footer { display: flex; align-items: baseline; justify-content: space-between; min-height: 70px; padding: 16px 0; border-top: 1px solid var(--line); color: var(--muted); font-size: .8rem; }
.footer-brand { color: var(--ink); font-size: 1.35rem; font-weight: 800; letter-spacing: -.075em; }
.empty-state, .panel, .form-shell { border: 1px solid var(--line); border-radius: var(--radius); background: var(--surface); padding: 25px; }
.empty-state { margin-top: 15px; }
.empty-state h3 { margin-bottom: 6px; }
.empty-state p { margin: 0; color: var(--muted); }
.form-shell { max-width: 520px; margin: 28px auto; padding: clamp(20px, 4vw, 34px); }
.form-shell.wide { max-width: 720px; }
.form-shell > p, .management-title p { margin: 10px 0 21px; color: var(--muted); }
.stack-form, .stack-form label { display: grid; gap: 6px; }
.stack-form { gap: 16px; }
.stack-form label, .invite-result label { font-size: .87rem; font-weight: 700; }
.stack-form input, .stack-form select, .invite-result input { width: 100%; font-weight: 400; }
.stack-form > .button, .stack-form .action-row { justify-self: start; }
.field-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.field-grid.costs { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.field-help { color: var(--muted); font-size: .82rem; margin: -6px 0 0; }
.notice { border-radius: 8px; padding: 9px 12px; font-size: .87rem; }
.notice ul { margin: 0; padding-left: 19px; }
.notice.error { background: #fae9e5; color: #873f35; }
.notice.success { background: #e6f2de; color: #315c40; }
.validation-summary-valid { display: none; }
.input-validation-error { border-color: #ab5046 !important; }
.management { margin-top: 20px; }
.management-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.25fr); gap: 16px; }
.panel h2 { margin-bottom: 14px; font-size: 1.25rem; }
.panel > .notice { margin-bottom: 13px; }
.invite-result { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 16px; }
.invite-result p, .invite-result [role="status"] { margin: 4px 0 9px; color: var(--muted); font-size: .8rem; }
.invite-result input { margin-bottom: 8px; font-size: .85rem; }
.member-list { list-style: none; margin: 0; padding: 0; }
.member-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 12px 0; border-top: 1px solid var(--line); }
.member-list li > div { min-width: 0; overflow-wrap: anywhere; }
.text-link { color: #356447; font-weight: 700; }
.market-sources { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; list-style: none; padding: 0; margin: 17px 0; }
.market-source { padding: 16px; min-width: 0; }
.market-source h3 { margin: 4px 0; font-size: 1.1rem; }
.market-source p, .market-price-note, .market-credit { color: var(--muted); font-size: .83rem; }
.market-source p { margin-bottom: 9px; }
.market-source .text-link, .market-add { font-size: .82rem; }
.market-add { margin-top: 12px; }
.market-table td:first-child { width: 41%; }
.market-table td:nth-child(2) { font-size: .85rem; }
.market-table td .text-link { display: inline-block; margin-top: 4px; }

@media (max-width: 720px) {
    .header-inner, .site-main, .site-footer { width: calc(100% - 32px); }
    .header-inner { gap: 17px; min-height: 62px; }
    .site-nav { gap: 13px; }
    .nav-link { font-size: .8rem; }
    .account-name { display: none; }
    .site-main { padding-top: 18px; }
    .search-hero { padding: 33px 25px 26px; border-radius: 18px; }
    .hero-lines { mask-image: linear-gradient(100deg, transparent 55%, #000); }
    .results-section { margin-top: 25px; }
    .insight { padding-inline: 14px; }
    .offer-table th, .offer-table td { padding-inline: 10px; }
    .management-grid { grid-template-columns: 1fr; }
    .market-sources { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 540px) {
    .brand { font-size: 29px; }
    .brand-mark { width: 25px; height: 25px; }
    .header-inner { width: calc(100% - 24px); gap: 12px; }
    .site-nav { gap: 9px; }
    .search-hero { padding-inline: 18px; }
    .search-hero h1 { font-size: clamp(1.8rem, 8vw, 2.6rem); }
    .search-form .button { padding-inline: 9px; font-size: .88rem; }
    .quick-search { gap: 5px; }
    .results-top { flex-wrap: wrap; }
    .insight-grid { gap: 8px; margin-block: 15px 20px; }
    .insight { padding: 11px 11px 13px; border-radius: 13px; }
    .insight strong { font-size: 1.43rem; }
    .insight-label, .insight p { font-size: .76rem; }
    .table-toolbar { flex-wrap: wrap; }
    .offer-table, .offer-table tbody { display: block; }
    .offer-table thead { position: absolute; clip-path: inset(50%); }
    .offer-table tbody tr { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.15fr); gap: 8px 8px; padding: 13px; }
    .offer-table td, .offer-table th:last-child, .offer-table td:last-child { padding: 0; border: 0 !important; text-align: left; }
    .offer-table td:first-child { grid-column: span 2; }
    .offer-table td:last-child { grid-column: span 2; }
    .offer-table td:last-child small { display: inline-block; margin-left: 6px; }
    .offer-table tbody tr + tr { border-top: 1px solid var(--line); }
    .field-grid.costs { grid-template-columns: minmax(0, 1fr); }
    .market-table td:first-child { width: auto; }
}

@media (max-width: 380px) {
    .header-inner { flex-wrap: wrap; gap: 8px 10px; padding-block: 8px; }
    .site-nav { order: 3; flex-basis: 100%; }
}
