:root {
  --paper: #f6f3eb;
  --paper-2: #ece7da;
  --ink: #19251f;
  --muted: #6d756f;
  --green: #214c3a;
  --green-2: #dbe5d6;
  --coral: #ee704f;
  --line: rgba(25, 37, 31, .16);
  --white: #fffdf8;
  --shadow: 0 20px 60px rgba(35, 45, 39, .14);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; color: var(--ink); background: var(--paper); font-family: "DM Sans", "Noto Sans SC", sans-serif; }
body.auth-locked { overflow: hidden; }
button, input, select, textarea { font: inherit; }
button { color: inherit; }
.grain { position: fixed; inset: 0; pointer-events: none; z-index: 10; opacity: .055; background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.75'/%3E%3C/svg%3E"); }
.auth-gate { position: fixed; inset: 0; z-index: 50; display: grid; place-items: center; overflow-y: auto; padding: 28px 16px; background: radial-gradient(circle at 78% 15%, rgba(238,112,79,.12), transparent 28%), radial-gradient(circle at 18% 82%, rgba(33,76,58,.14), transparent 32%), var(--paper); }
.auth-gate[hidden] { display: none; }
.auth-card { width: min(430px, 100%); padding: 34px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,253,248,.94); box-shadow: 0 28px 90px rgba(25,37,31,.18); }
.auth-brand { display: flex; align-items: center; gap: 11px; margin-bottom: 35px; font-size: 17px; letter-spacing: .05em; }
.auth-card h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.auth-intro { margin: 10px 0 24px; color: var(--muted); font-size: 13px; line-height: 1.7; }
.auth-form { display: grid; gap: 15px; }
.auth-form[hidden] { display: none; }
.auth-form .primary-button { margin-top: 5px; }
.password-toggle { display: inline-flex; align-items: center; gap: 7px; width: fit-content; color: var(--muted); cursor: pointer; font-size: 11px; }
.password-toggle input { width: 15px; height: 15px; margin: 0; accent-color: var(--green); }
.auth-switch { margin: 4px 0 0; color: var(--muted); font-size: 12px; text-align: center; }
.auth-switch button { padding: 3px 5px; border: 0; color: var(--green); background: transparent; cursor: pointer; font-weight: 700; }
.auth-switch button:hover { text-decoration: underline; }
.auth-message { min-height: 21px; margin: 17px 0 0; color: #a74835; font-size: 12px; font-weight: 600; }
.auth-message.success { color: var(--green); }
.auth-security { margin: 18px 0 0; padding-top: 15px; border-top: 1px solid var(--line); color: var(--muted); font-size: 10px; text-align: center; }
.topbar { height: 76px; display: flex; align-items: center; justify-content: space-between; padding: 0 max(5vw, 24px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 8; background: rgba(246,243,235,.92); backdrop-filter: blur(16px); }
.brand { display: flex; gap: 11px; align-items: center; color: var(--ink); text-decoration: none; font-weight: 700; font-size: 19px; letter-spacing: .05em; }
.brand-mark { display: grid; place-items: center; width: 37px; height: 37px; color: var(--paper); background: var(--green); border-radius: 50% 50% 46% 54% / 55% 45% 55% 45%; font-family: "Noto Sans SC"; }
.top-actions { display: flex; gap: 10px; align-items: center; }
.user-chip { max-width: 130px; overflow: hidden; padding: 7px 10px; border-radius: 99px; color: var(--green); background: var(--green-2); font-size: 11px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.primary-button, .secondary-button { border: 0; border-radius: 7px; padding: 11px 18px; cursor: pointer; font-weight: 600; transition: .2s ease; }
.primary-button { background: var(--green); color: #fff; box-shadow: 0 5px 0 #153427; }
.primary-button:hover { transform: translateY(-2px); box-shadow: 0 7px 0 #153427; }
.primary-button:active { transform: translateY(3px); box-shadow: 0 2px 0 #153427; }
.secondary-button { background: transparent; border: 1px solid var(--line); }
.secondary-button:hover { background: var(--paper-2); }
.icon-button, .close-button { display: grid; place-items: center; border: 1px solid var(--line); background: transparent; cursor: pointer; }
.icon-button { width: 42px; height: 42px; border-radius: 50%; }
.icon-button svg, .search-box svg { width: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; }
main { width: min(1180px, 90vw); margin: 0 auto; }
.hero { min-height: 360px; display: flex; align-items: center; justify-content: space-between; padding: 66px 5%; border-bottom: 1px solid var(--line); }
.eyebrow { margin: 0 0 12px; color: var(--coral); font-size: 11px; font-weight: 700; letter-spacing: .2em; }
.hero h1 { margin: 0; max-width: 740px; font-family: "Noto Sans SC", sans-serif; font-size: clamp(46px, 6vw, 78px); line-height: 1.08; letter-spacing: -.05em; }
.hero h1 em { color: var(--green); font-style: normal; position: relative; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 8px; background: var(--coral); opacity: .45; border-radius: 50%; z-index: -1; transform: rotate(-1deg); }
.hero-copy { color: var(--muted); font-size: 16px; margin-top: 22px; }
.hero-stamp { width: 132px; height: 132px; flex: 0 0 auto; border: 2px solid var(--coral); color: var(--coral); border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; transform: rotate(8deg); box-shadow: inset 0 0 0 5px var(--paper), inset 0 0 0 6px var(--coral); margin-left: 30px; }
.hero-stamp span { font-size: 12px; letter-spacing: .22em; }
.hero-stamp strong { font-size: 22px; letter-spacing: .2em; margin: 4px 0; }
.hero-stamp small { font-size: 8px; letter-spacing: .15em; }
.stats { display: grid; grid-template-columns: repeat(4, 1fr); border-bottom: 1px solid var(--line); }
.stats > article, .stats > button { min-height: 125px; padding: 25px 28px; border: 0; border-right: 1px solid var(--line); display: flex; align-items: baseline; flex-wrap: wrap; align-content: center; gap: 4px; color: var(--ink); background: transparent; text-align: left; }
.stats > :last-child { border-right: 0; }
.stats span { width: 100%; color: var(--muted); font-size: 12px; margin-bottom: 6px; }
.stats strong { font-size: 34px; letter-spacing: -.05em; }
.stats small { color: var(--muted); }
.stats .stat-card { position: relative; cursor: pointer; transition: background .2s ease, color .2s ease; }
.stats .stat-card:hover, .stats .stat-card.active { color: var(--green); background: var(--green-2); }
.stats .stat-card i { width: 100%; margin-top: 8px; color: var(--green); font-size: 10px; font-style: normal; font-weight: 700; opacity: 0; transform: translateY(3px); transition: .2s ease; }
.stats .stat-card:hover i, .stats .stat-card.active i { opacity: 1; transform: translateY(0); }
.workspace { padding: 58px 0 100px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; margin-bottom: 25px; }
.section-heading h2 { margin: 0; font-size: 30px; }
.archive-back { margin: 10px 0 0; padding: 0; border: 0; color: var(--green); background: transparent; cursor: pointer; font-size: 11px; font-weight: 700; }
.archive-back:hover { text-decoration: underline; }
.view-tabs { padding: 3px; background: var(--paper-2); border-radius: 7px; display: flex; }
.view-tabs button { border: 0; background: transparent; padding: 7px 15px; border-radius: 5px; cursor: pointer; color: var(--muted); }
.view-tabs button.active { background: var(--white); color: var(--ink); box-shadow: 0 2px 8px rgba(0,0,0,.06); }
.filters { display: grid; grid-template-columns: 1fr 170px 170px; gap: 10px; margin-bottom: 24px; }
.filters input, .filters select { height: 48px; background: rgba(255,253,248,.7); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); outline: none; }
.filters select { padding: 0 14px; }
.search-box { position: relative; }
.search-box svg { position: absolute; left: 15px; top: 14px; color: var(--muted); }
.search-box input { width: 100%; padding: 0 14px 0 46px; }
input:focus, select:focus, textarea:focus { border-color: var(--green) !important; box-shadow: 0 0 0 3px rgba(33,76,58,.1); }
.calendar-toolbar { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; margin: 2px 0 14px; }
.calendar-toolbar h3 { margin: 0; font-size: 21px; letter-spacing: -.02em; }
.calendar-nav { display: flex; align-items: center; gap: 6px; }
.calendar-nav button { height: 34px; min-width: 34px; padding: 0 10px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); cursor: pointer; }
.calendar-nav button:hover { background: var(--paper-2); }
.calendar-legend { justify-self: end; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 10px; }
.calendar-legend span { width: 8px; height: 8px; margin-left: 6px; border-radius: 50%; }
.legend-selected { background: #4f9569; }
.legend-pending { background: #d59b2b; }
.legend-rejected { background: #c95b49; }
.legend-not-participating { background: #8b8d87; opacity: .55; }
.calendar-scroll { overflow-x: auto; padding-bottom: 5px; }
.market-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.market-grid.calendar-view { min-width: 770px; grid-template-columns: repeat(7, minmax(110px, 1fr)); gap: 0; border: 1px solid var(--line); border-radius: 9px; overflow: hidden; background: rgba(255,253,248,.64); }
.calendar-weekday { min-height: 38px; display: grid; place-items: center; color: var(--muted); background: var(--paper-2); border-right: 1px solid var(--line); font-size: 11px; font-weight: 700; }
.calendar-weekday:nth-child(7) { border-right: 0; }
.calendar-day { min-height: 128px; padding: 8px; border-top: 1px solid var(--line); border-right: 1px solid var(--line); background: rgba(255,253,248,.65); overflow: hidden; }
.calendar-day:nth-child(7n) { border-right: 0; }
.calendar-day.outside-month { background: rgba(236,231,218,.38); color: #aaa9a1; }
.calendar-day.today { background: rgba(219,229,214,.58); }
.calendar-date { display: flex; align-items: center; justify-content: space-between; margin-bottom: 6px; font-size: 11px; font-weight: 600; }
.calendar-day.today .calendar-date strong { width: 23px; height: 23px; display: grid; place-items: center; border-radius: 50%; color: white; background: var(--coral); }
.calendar-event { width: 100%; display: block; margin: 4px 0; padding: 6px 7px; border: 0; border-left: 3px solid #89938c; border-radius: 4px; background: #e9ece9; color: var(--ink); text-align: left; cursor: pointer; overflow: hidden; }
.calendar-event:hover { filter: brightness(.96); }
.calendar-event strong, .calendar-event small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.calendar-event strong { font-size: 10px; }
.calendar-event small { margin-top: 3px; color: var(--muted); font-size: 8px; }
.calendar-event .event-weather { color: #40554a; font-weight: 700; }
.calendar-event .event-weather.weather-muted { color: #8b8d87; font-weight: 500; }
.calendar-event.selection-selected { background: #dcebdc; border-left-color: #4f9569; }
.calendar-event.selection-pending { background: #fff0c9; border-left-color: #d59b2b; }
.calendar-event.selection-rejected { background: #f8ded8; border-left-color: #c95b49; }
.calendar-event.selection-not-participating { opacity: .5; background: #e7e5df; border-left-color: #8b8d87; filter: grayscale(.35); }
.market-card { background: rgba(255,253,248,.76); border: 1px solid var(--line); border-radius: 9px; padding: 22px; cursor: pointer; position: relative; min-height: 260px; transition: .2s ease; overflow: hidden; }
.market-card.not-participating { opacity: .5; filter: grayscale(.35); }
.market-card.not-participating:hover { opacity: .65; }
.market-card::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 5px; background: var(--green); transform: scaleX(0); transform-origin: left; transition: .25s ease; }
.market-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: rgba(33,76,58,.35); }
.market-card:hover::after { transform: scaleX(1); }
.card-top { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.status { display: inline-flex; align-items: center; gap: 6px; font-size: 11px; font-weight: 600; padding: 5px 9px; border-radius: 99px; background: var(--green-2); color: var(--green); }
.status::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.status.ended { background: #e7e5df; color: #777870; }
.status.ongoing { background: #fde1d8; color: #a63a21; }
.card-city { color: var(--muted); font-size: 12px; }
.market-card h3 { margin: 20px 0 10px; font-size: 22px; line-height: 1.35; }
.card-place { color: var(--muted); font-size: 13px; min-height: 20px; }
.card-organizer { color: var(--green); font-size: 11px; font-weight: 600; margin-top: 5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-signals { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; min-height: 24px; }
.signal { padding: 4px 8px; border: 1px solid transparent; border-radius: 99px; background: var(--paper-2); color: var(--muted); font-size: 10px; font-weight: 700; }
.signal.intent-high { background: #dcebdc; border-color: #a8cbaa; color: #23633a; }
.signal.intent-medium { background: #fff0c9; border-color: #e5c978; color: #8a5b00; }
.signal.intent-low { background: #f8ded8; border-color: #e4aaa0; color: #a5392c; }
.signal.strength-strong { background: #dbe5f5; border-color: #adc2e3; color: #28598e; }
.signal.strength-medium { background: #ebe6d8; border-color: #d5c8a6; color: #716032; }
.signal.strength-weak { background: #eee2df; border-color: #d8b9b2; color: #8b4b40; }
.signal.trust-good { background: var(--green-2); color: var(--green); }
.signal.trust-risk { background: #f7ddd5; color: #a74835; }
.signal.reminder { background: #eee3f6; border-color: #d0b6df; color: #714686; }
.card-date { margin: 23px 0 18px; display: flex; align-items: center; gap: 12px; }
.date-box { border: 1px solid var(--line); width: 48px; height: 52px; display: grid; place-items: center; border-radius: 5px; line-height: 1; }
.date-box strong { font-size: 20px; }
.date-box small { color: var(--coral); font-size: 9px; font-weight: 700; }
.date-copy strong, .date-copy small { display: block; }
.date-copy strong { font-size: 13px; }
.date-copy small { color: var(--muted); margin-top: 5px; }
.card-footer { border-top: 1px dashed var(--line); padding-top: 14px; display: flex; align-items: center; justify-content: space-between; font-size: 12px; color: var(--muted); }
.selection-result { color: var(--muted); }
.selection-result.selected { color: var(--green); font-weight: 700; }
.selection-result.rejected { color: #a74835; }
.selection-result.not-participating { color: #686b66; font-weight: 700; }
.score { color: #d65a3b; letter-spacing: 1px; }
.market-grid.table-view { display: block; border-top: 1px solid var(--line); }
.table-view .market-card { min-height: auto; border-width: 0 0 1px; border-radius: 0; display: grid; grid-template-columns: 140px 1fr 180px 160px; align-items: center; gap: 15px; padding: 18px 5px; background: transparent; }
.table-view .market-card:hover { transform: none; box-shadow: none; background: rgba(255,255,255,.3); }
.table-view .market-card h3 { margin: 0; font-size: 17px; }
.table-view .card-place { min-height: 0; }
.table-view .card-organizer { display: none; }
.table-view .card-signals { display: none; }
.table-view .card-date { margin: 0; }
.table-view .date-box { display: none; }
.table-view .card-footer { border: 0; padding: 0; }
.map-panel { border: 1px solid var(--line); border-radius: 11px; background: rgba(255,253,248,.72); overflow: hidden; box-shadow: 0 18px 45px rgba(31,48,39,.07); }
.map-toolbar { min-height: 68px; display: flex; align-items: center; justify-content: space-between; gap: 15px; padding: 12px 16px 12px 20px; border-bottom: 1px solid var(--line); }
.map-toolbar strong, .map-toolbar span { display: block; }
.map-toolbar strong { font-size: 15px; }
.map-toolbar span { margin-top: 3px; color: var(--muted); font-size: 11px; }
.locate-button { min-width: 110px; padding: 9px 14px; font-size: 12px; }
.locate-button:disabled { opacity: .6; cursor: wait; transform: none; }
.manual-route-form { display: grid; grid-template-columns: minmax(0,1fr) auto minmax(0,1fr) auto; align-items: end; gap: 10px; padding: 13px 16px; border-bottom: 1px solid var(--line); background: var(--paper-2); }
.manual-route-form label span { display: block; margin-bottom: 5px; color: var(--muted); font-size: 9px; font-weight: 700; }
.manual-route-form input { width: 100%; height: 40px; padding: 0 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--white); outline: none; }
.manual-route-form button { min-height: 40px; white-space: nowrap; }
.manual-route-form button:disabled { opacity: .55; cursor: wait; }
.route-arrow { align-self: center; margin-top: 14px; color: var(--muted); }
.market-map-layout { display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(315px, .75fr); min-height: 590px; }
.market-map { min-height: 590px; background: #e7e5dc; }
.trip-panel { min-width: 0; padding: 23px; border-left: 1px solid var(--line); background: rgba(250,248,241,.96); overflow-y: auto; }
.trip-empty { min-height: 470px; display: flex; flex-direction: column; align-items: start; justify-content: center; }
.trip-empty > span { color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .18em; }
.trip-empty h3 { margin: 12px 0 8px; font-size: 24px; line-height: 1.3; }
.trip-empty p { margin: 0 0 22px; color: var(--muted); font-size: 12px; line-height: 1.7; }
.trip-empty > small { margin-top: 14px; color: var(--muted); font-size: 9px; }
.trip-loading { min-height: 470px; display: grid; place-content: center; gap: 6px; text-align: center; }
.trip-loading span { color: var(--muted); font-size: 12px; }
.trip-heading { display: flex; align-items: start; justify-content: space-between; gap: 10px; }
.trip-heading small { color: var(--coral); font-size: 10px; font-weight: 800; letter-spacing: .08em; }
.trip-heading h3 { margin: 7px 0 4px; font-size: 22px; line-height: 1.3; }
.trip-heading p { margin: 0; color: var(--muted); font-size: 11px; }
.trip-refresh { width: 34px; height: 34px; border: 1px solid var(--line); border-radius: 50%; color: var(--green); background: var(--white); cursor: pointer; font-size: 17px; }
.trip-distance { margin: 20px 0 16px; padding: 16px; border-radius: 8px; color: white; background: var(--green); }
.trip-distance strong, .trip-distance span { display: block; }
.trip-distance strong { font-size: 31px; letter-spacing: -.04em; }
.trip-distance strong small { margin-left: 4px; font-size: 12px; font-weight: 500; }
.trip-distance span { margin-top: 3px; color: rgba(255,255,255,.72); font-size: 10px; }
.trip-modes { display: grid; gap: 9px; }
.trip-mode { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 10px; padding: 13px 12px; border: 1px solid var(--line); border-radius: 8px; background: var(--white); }
.trip-mode.muted { opacity: .58; }
.trip-mode-icon { width: 36px; height: 36px; display: grid; place-items: center; border-radius: 50%; background: var(--paper-2); font-size: 18px; }
.trip-mode small, .trip-mode strong, .trip-mode span { display: block; }
.trip-mode small { color: var(--muted); font-size: 9px; }
.trip-mode strong { margin: 2px 0; font-size: 14px; }
.trip-mode span { color: var(--muted); font-size: 8px; line-height: 1.35; }
.trip-mode b { color: var(--coral); font-size: 12px; white-space: nowrap; }
.trip-note, .map-disclaimer { color: var(--muted); font-size: 9px; line-height: 1.6; }
.trip-note { margin: 15px 2px 0; }
.map-disclaimer { margin: 0; padding: 10px 18px; border-top: 1px solid var(--line); background: var(--paper-2); }
.market-map-marker-shell { background: transparent; border: 0; }
.market-map-marker { width: 34px; height: 34px; display: grid; place-items: center; border: 3px solid white; border-radius: 50% 50% 50% 7px; transform: rotate(-45deg); color: white; background: #d59b2b; box-shadow: 0 4px 13px rgba(24,44,34,.3); font-size: 12px; font-weight: 800; }
.market-map-marker b { transform: rotate(45deg); font-size: 12px; }
.market-map-marker.selected { background: #4f9569; }
.market-map-marker.rejected { background: #c95b49; }
.market-map-marker.not-participating { opacity: .5; background: #8b8d87; filter: grayscale(.35); }
.map-popup { min-width: 170px; }
.map-popup small, .map-popup strong, .map-popup span { display: block; }
.map-popup small { color: var(--muted); font-size: 9px; }
.map-popup strong { margin: 5px 0; font-size: 14px; }
.map-popup span { color: var(--muted); font-size: 10px; }
.map-popup button { margin-top: 10px; padding: 0; border: 0; color: var(--green); background: transparent; font-size: 10px; font-weight: 800; cursor: pointer; }
.leaflet-container { font-family: "DM Sans", "Noto Sans SC", sans-serif; }
.empty-state { text-align: center; padding: 70px 0; }
.empty-illustration { margin: 0 auto 20px; width: 78px; height: 60px; background: var(--green-2); border: 2px solid var(--green); display: grid; place-items: center; font-size: 24px; position: relative; }
.empty-illustration::before { content: ""; position: absolute; top: -20px; left: -7px; right: -7px; height: 20px; background: repeating-linear-gradient(90deg,var(--coral) 0 22px,var(--white) 22px 44px); border: 2px solid var(--green); transform: perspective(30px) rotateX(5deg); }
.empty-state h3 { margin: 0 0 8px; }
.empty-state p { margin: 0 0 24px; color: var(--muted); }
.drawer-backdrop { position: fixed; inset: 0; background: rgba(18,28,23,.42); backdrop-filter: blur(3px); z-index: 19; }
#settingsBackdrop { z-index: 21; }
.drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 20; width: min(650px, 100%); background: var(--white); transform: translateX(102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: -20px 0 80px rgba(12,23,17,.2); }
.drawer.open { transform: translateX(0); }
.drawer form { height: 100%; display: flex; flex-direction: column; }
.settings-drawer { position: fixed; right: 0; top: 0; bottom: 0; z-index: 22; width: min(560px, 100%); background: var(--white); transform: translateX(102%); transition: transform .3s cubic-bezier(.2,.8,.2,1); box-shadow: -20px 0 80px rgba(12,23,17,.2); }
.settings-drawer.open { transform: translateX(0); }
.settings-drawer form { height: 100%; display: flex; flex-direction: column; }
.settings-scroll { flex: 1 1 auto; overflow-y: auto; padding: 0 30px 35px; }
.settings-section { padding: 27px 0; border-bottom: 1px solid var(--line); }
.settings-section:last-child { border-bottom: 0; }
.settings-section > h3, .settings-section-title h3 { margin: 0 0 17px; font-size: 16px; }
.settings-section > .field + .field { margin-top: 14px; }
.settings-section-title { display: flex; align-items: start; justify-content: space-between; gap: 15px; margin-bottom: 18px; }
.settings-section-title h3 { margin-bottom: 5px; }
.settings-section-title p { margin: 0; color: var(--muted); font-size: 11px; }
.text-button { padding: 5px 0; border: 0; background: transparent; color: var(--green); font-size: 11px; font-weight: 700; cursor: pointer; white-space: nowrap; }
.order-group { margin-bottom: 22px; }
.order-group:last-child { margin-bottom: 0; }
.order-group h4 { margin: 0 0 8px; color: var(--muted); font-size: 11px; letter-spacing: .08em; }
.order-list { border: 1px solid var(--line); border-radius: 7px; overflow: hidden; }
.order-item { min-height: 45px; display: flex; align-items: center; gap: 10px; padding: 7px 8px 7px 13px; border-bottom: 1px solid var(--line); background: #fbfaf6; }
.order-item:last-child { border-bottom: 0; }
.order-item.dragging { opacity: .42; background: var(--green-2); pointer-events: none; }
.drag-handle { width: 20px; color: #9a9d96; font-size: 17px; line-height: 1; cursor: grab; user-select: none; touch-action: none; }
.drag-handle:active { cursor: grabbing; }
body.sorting-fields, body.sorting-fields * { cursor: grabbing !important; user-select: none !important; }
.order-index { width: 20px; color: #aaa89f; font-size: 10px; }
.order-label { flex: 1; min-width: 0; font-size: 12px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.order-actions { display: flex; gap: 4px; }
.order-actions button { width: 30px; height: 30px; border: 1px solid var(--line); border-radius: 5px; background: var(--white); cursor: pointer; }
.order-actions button:hover:not(:disabled) { color: white; border-color: var(--green); background: var(--green); }
.order-actions button:disabled { opacity: .25; cursor: not-allowed; }
.drawer-header { flex: 0 0 auto; padding: 24px 30px 20px; border-bottom: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between; }
.drawer-header h2 { margin: 0; font-size: 26px; }
.close-button { width: 38px; height: 38px; border-radius: 50%; font-size: 27px; line-height: 1; }
.form-scroll { flex: 1 1 auto; overflow-y: auto; padding: 0 30px 35px; }
.form-section { padding: 27px 0 6px; border-bottom: 1px solid var(--line); }
.form-section:last-child { border-bottom: 0; }
.form-section h3 { margin: 0 0 20px; font-size: 15px; }
.form-section h3 > span { display: inline-grid; place-items: center; width: 28px; height: 28px; margin-right: 8px; background: var(--green); color: white; border-radius: 50%; font-size: 10px; }
.form-section h3 small { color: var(--muted); font-weight: 400; margin-left: 8px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field { min-width: 0; }
.field.full { grid-column: 1 / -1; }
.field label { display: block; color: #4c5751; font-size: 12px; font-weight: 600; margin-bottom: 7px; }
.field input, .field select, .field textarea { width: 100%; background: #fbfaf6; border: 1px solid var(--line); border-radius: 6px; padding: 11px 12px; color: var(--ink); outline: none; }
.field input, .field select { height: 44px; }
.field textarea { resize: vertical; }
.suffix-input { position: relative; }
.suffix-input input { padding-right: 38px; }
.suffix-input span { position: absolute; right: 13px; top: 50%; transform: translateY(-50%); color: var(--green); font-size: 14px; font-weight: 800; }
.checkbox-field { min-height: 44px; padding: 9px 12px; border: 1px solid var(--line); border-radius: 6px; background: #fbfaf6; }
.checkbox-field > label { display: flex; align-items: center; gap: 9px; margin: 0; cursor: pointer; }
.checkbox-field input[type="checkbox"] { width: 18px; height: 18px; flex: 0 0 auto; margin: 0; accent-color: var(--green); }
.checkbox-field > small { display: block; margin: 4px 0 0 27px; color: var(--muted); font-size: 9px; }
.contact-menu { border: 1px solid var(--line); border-radius: 7px; background: #fbfaf6; overflow: hidden; }
.contact-menu summary { padding: 12px 14px; cursor: pointer; color: #4c5751; font-size: 12px; font-weight: 700; list-style-position: inside; }
.contact-menu summary small { margin-left: 5px; color: var(--muted); font-weight: 400; }
.contact-menu[open] summary { border-bottom: 1px solid var(--line); background: var(--paper-2); }
.contact-fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; padding: 14px; }
.review-section { background: linear-gradient(90deg, rgba(219,229,214,.3), transparent); margin: 18px -15px 0; padding-left: 15px; padding-right: 15px; border-radius: 8px; }
.field-subitem { margin-top: 10px; padding: 11px 12px 12px; border: 1px dashed var(--line); border-radius: 9px; background: rgba(255,255,255,.48); }
.field-subitem label { display: flex; align-items: center; gap: 6px; margin-bottom: 7px; font-size: 12px; color: var(--muted); }
.field-subitem label small { font-weight: 400; opacity: .75; }
.field-subitem > small { display: block; margin-top: 7px; color: var(--muted); font-size: 9px; line-height: 1.5; }
.drawer-footer { flex: 0 0 auto; display: flex; align-items: center; gap: 10px; padding: 17px 30px 20px; border-top: 1px solid var(--line); background: var(--white); }
.footer-spacer { flex: 1; }
.danger-link { border: 0; color: #b83c2b; background: transparent; cursor: pointer; padding: 8px 0; }
.toast { position: fixed; bottom: 28px; left: 50%; z-index: 30; transform: translate(-50%, 30px); background: var(--ink); color: #fff; padding: 11px 18px; border-radius: 99px; font-size: 13px; opacity: 0; pointer-events: none; transition: .25s ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 900px) {
  .hero { min-height: 330px; padding-left: 0; padding-right: 0; }
  .market-grid { grid-template-columns: 1fr 1fr; }
  .stats article { padding: 20px; }
  .table-view .market-card { grid-template-columns: 110px 1fr 170px; }
  .table-view .card-footer { display: none; }
  .market-map-layout { grid-template-columns: 1fr; }
  .market-map { min-height: 500px; }
  .trip-panel { border-left: 0; border-top: 1px solid var(--line); }
  .trip-empty, .trip-loading { min-height: 230px; }
}
@media (max-width: 640px) {
  .auth-card { padding: 27px 22px; }
  .auth-brand { margin-bottom: 26px; }
  .topbar { padding: 0 16px; height: 68px; }
  .user-chip { display: none; }
  .top-actions .primary-button { font-size: 0; width: 42px; padding: 10px; }
  .top-actions .primary-button span { font-size: 22px; }
  main { width: calc(100% - 32px); }
  .hero { min-height: 300px; padding: 48px 0; }
  .hero h1 { font-size: 43px; }
  .hero-stamp { display: none; }
  .stats { grid-template-columns: 1fr 1fr; }
  .stats > article, .stats > button { min-height: 95px; border-bottom: 1px solid var(--line); }
  .stats > :nth-child(2) { border-right: 0; }
  .workspace { padding-top: 42px; }
  .section-heading { align-items: center; }
  .section-heading h2 { font-size: 25px; }
  .filters { grid-template-columns: 1fr 1fr; }
  .search-box { grid-column: 1 / -1; }
  .market-grid { grid-template-columns: 1fr; }
  .view-tabs button { padding: 6px 9px; font-size: 11px; }
  .map-toolbar { align-items: start; }
  .map-toolbar span { max-width: 190px; }
  .manual-route-form { grid-template-columns: 1fr 1fr; }
  .route-arrow { display: none; }
  .manual-route-form button { grid-column: 1 / -1; }
  .market-map { min-height: 410px; }
  .trip-panel { padding: 18px; }
  .trip-mode { grid-template-columns: 34px minmax(0,1fr); }
  .trip-mode b { grid-column: 2; }
  .calendar-toolbar { grid-template-columns: 1fr auto; row-gap: 10px; }
  .calendar-toolbar h3 { grid-column: 2; grid-row: 1; font-size: 17px; }
  .calendar-legend { grid-column: 1 / -1; justify-self: start; }
  .drawer-header, .drawer-footer { padding-left: 18px; padding-right: 18px; }
  .settings-scroll { padding-left: 18px; padding-right: 18px; }
  .form-scroll { padding-left: 18px; padding-right: 18px; }
  .form-grid { grid-template-columns: 1fr; }
  .field.full { grid-column: auto; }
  .contact-fields { grid-template-columns: 1fr; }
  .form-section h3 small { display: block; margin: 7px 0 0 39px; }
}
