:root {
  color-scheme: light;
  --ink: #1e2925;
  --muted: #77827b;
  --green: #287456;
  --green-dark: #1c6045;
  --green-soft: #e8f1ec;
  --paper: #f5f6f2;
  --white: #fff;
  --line: #e5e9e3;
  --red: #a34238;
  font-family: "DM Sans", sans-serif;
}

* { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); }
a { color: var(--green); text-decoration: none; }
a:hover { color: var(--green-dark); }
button, input, select { font: inherit; }
.topbar { height: 70px; padding: 0 max(calc((100% - 1180px) / 2), 24px); display: flex; align-items: center; justify-content: space-between; background: var(--white); border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; gap: 10px; align-items: center; color: var(--ink); font: 800 17px Manrope, sans-serif; letter-spacing: -.5px; }
.brand-mark { display: grid; place-items: center; width: 32px; height: 32px; border-radius: 10px; color: white; background: var(--green); }
.top-account { display: flex; align-items: center; gap: 18px; font-size: 14px; }
.balance { font-weight: 700; color: var(--green); }
.top-account form, .action-row form, .property-actions form, .job-apply form { margin: 0; }
.nav-wrap { min-height: 50px; padding: 0 max(calc((100% - 1180px) / 2), 24px); display: flex; align-items: stretch; gap: 28px; background: white; border-bottom: 1px solid var(--line); overflow-x: auto; }
.nav-wrap a { display: inline-flex; align-items: center; white-space: nowrap; color: var(--muted); font-size: 13px; font-weight: 600; border-bottom: 2px solid transparent; }
.nav-wrap a:hover, .nav-wrap a.active { color: var(--green); border-color: var(--green); }
.page { width: min(1180px, calc(100% - 48px)); margin: 42px auto 80px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: Manrope, sans-serif; letter-spacing: -.7px; }
h1 { margin-bottom: 10px; font-size: clamp(30px, 4vw, 42px); line-height: 1.12; }
h2 { margin-bottom: 16px; font-size: 22px; }
h3 { margin: 12px 0 4px; font-size: 18px; }
p { color: var(--muted); line-height: 1.65; }
.eyebrow { margin: 0 0 9px; color: var(--green); font-size: 10px; font-weight: 700; letter-spacing: 1.35px; }
.hero { display: flex; align-items: center; justify-content: space-between; gap: 24px; margin-bottom: 32px; padding: 35px 40px; border-radius: 18px; color: white; background: radial-gradient(circle at 82% 15%, #65a684 0, transparent 31%), linear-gradient(118deg, #214d3c, #327a59); }
.hero h1, .hero p { color: white; }
.hero p { margin-bottom: 0; opacity: .78; }
.hero .eyebrow { color: #c9e8d6; }
.button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; padding: 0 17px; border: 1px solid transparent; border-radius: 9px; cursor: pointer; font-size: 13px; font-weight: 700; transition: .15s ease; }
.button:hover { transform: translateY(-1px); }
.button:disabled { cursor: not-allowed; opacity: .5; transform: none; }
.button-primary { color: white; background: var(--green); }
.button-primary:hover { color: white; background: var(--green-dark); }
.hero .button-primary { color: var(--green-dark); background: white; }
.hero .button-primary:hover { background: #eef5f0; }
.button-secondary { color: var(--green-dark); background: var(--green-soft); }
.button-secondary:hover { background: #dcebe1; }
.button-quiet { color: var(--muted); background: transparent; border-color: var(--line); }
.button-quiet:hover { color: var(--ink); background: #f7f8f6; }
.button-small { min-height: 34px; padding: 0 12px; font-size: 12px; }
.button-wide { width: 100%; }
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-bottom: 42px; }
.stat-card { min-width: 0; padding: 20px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.stat-card > span { display: block; margin-bottom: 12px; color: var(--muted); font-size: 12px; font-weight: 600; }
.stat-card strong { display: block; margin-bottom: 5px; font: 800 25px Manrope, sans-serif; letter-spacing: -.7px; }
.stat-card small { color: var(--muted); font-size: 11px; }
.meter { height: 6px; margin-top: 12px; overflow: hidden; border-radius: 99px; background: #e8ece8; }
.meter i { display: block; height: 100%; border-radius: inherit; background: #d08f4e; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin: 35px 0 16px; }
.section-heading h2 { margin: 0; }
.section-heading .eyebrow { margin-bottom: 5px; }
.text-link { font-size: 13px; font-weight: 700; }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 13px; }
.feature-card { padding: 21px; border: 1px solid var(--line); border-radius: 13px; background: white; transition: .16s ease; }
.feature-card:hover { transform: translateY(-2px); border-color: #c5d9ca; box-shadow: 0 8px 20px #2b56320d; }
.feature-icon { display: grid; width: 35px; height: 35px; place-items: center; border-radius: 10px; color: var(--green); background: var(--green-soft); font-weight: 700; }
.feature-card h3 { margin-top: 16px; }
.feature-card p { margin-bottom: 0; font-size: 13px; }
.page-heading { margin-bottom: 28px; }
.page-heading p:last-child { margin-bottom: 0; }
.count { display: inline-grid; min-width: 25px; height: 25px; place-items: center; vertical-align: 2px; border-radius: 20px; color: var(--green); background: var(--green-soft); font: 700 12px "DM Sans", sans-serif; }
.split-layout { display: grid; grid-template-columns: minmax(0, 1.55fr) minmax(280px, .9fr); gap: 25px; align-items: start; }
.company-list { display: grid; gap: 12px; }
.company-card, .card { padding: 21px; border: 1px solid var(--line); border-radius: 13px; background: white; }
.company-top { display: flex; justify-content: space-between; align-items: start; gap: 15px; }
.company-top p { margin-bottom: 0; font-size: 13px; }
.company-top h3 { margin-top: 9px; }
.tag { display: inline-block; padding: 5px 8px; border-radius: 5px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.price { white-space: nowrap; color: var(--ink); font: 800 17px Manrope, sans-serif; }
.positive { color: #26734f !important; }
.negative { color: #ad453a !important; }
.share-summary { margin: 0 0 14px; }
.share-summary h2 { margin: 0 0 6px; }
.share-summary p:last-child { margin-bottom: 0; }
.financial-card { margin-bottom: 14px; }
.financial-heading { margin: 0 0 18px; }
.financial-heading h2 { margin: 0; }
.financial-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.financial-grid > div { display: grid; gap: 6px; padding: 14px; border-radius: 9px; background: #f7f9f6; }
.financial-grid span { color: var(--muted); font-size: 11px; }
.financial-grid strong { font-size: 15px; }
.financial-grid .financial-total { background: var(--green-soft); }
.price-chart { padding-top: 15px; margin-top: 18px; border-top: 1px solid var(--line); }
.chart-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.chart-heading div { display: grid; gap: 3px; }
.chart-heading strong { font-size: 13px; }
.chart-heading span { color: var(--muted); font-size: 10px; }
.chart-heading b { font-size: 12px; }
.price-chart svg, .mini-chart svg { display: block; width: 100%; height: auto; margin: 8px 0 0; overflow: visible; }
.chart-grid { stroke: #e8ede8; stroke-width: 1; }
.chart-line { fill: none; stroke: var(--green); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; vector-effect: non-scaling-stroke; }
.chart-dot { fill: var(--green); stroke: white; stroke-width: 2; vector-effect: non-scaling-stroke; }
.chart-axis { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); font-size: 10px; }
.mini-chart { padding-top: 14px; margin-top: 14px; border-top: 1px solid var(--line); }
.mini-chart .chart-line { stroke-width: 2; }
.mini-chart .chart-heading span { max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.leaderboard-self { background: #f0f7f1; }
.rank-badge { display: inline-grid; width: 27px; height: 27px; place-items: center; border-radius: 50%; color: var(--green-dark); background: var(--green-soft); font-weight: 700; }
.you-label { display: inline-block; margin-left: 8px; padding: 3px 6px; border-radius: 5px; color: var(--green-dark); background: var(--green-soft); font-size: 10px; font-weight: 700; }
.potential-value { color: var(--green-dark); font-weight: 700; }
.transfer-limit > strong { display: block; margin: 8px 0 15px; color: var(--green-dark); font: 800 32px Manrope, sans-serif; }
.transfer-limit p { margin-bottom: 8px; }
.company-meta { display: flex; flex-wrap: wrap; gap: 10px 20px; padding: 15px 0; margin: 14px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); color: var(--muted); font-size: 11px; }
.form-card { position: sticky; top: 20px; }
.form-card-static { position: static; }
.form-card h2 { margin-bottom: 20px; }
.company-creation-form .form-card { position: static; }
.product-editor { flex-wrap: wrap; padding: 14px 0; border-bottom: 1px solid var(--line); }
.product-editor label { flex: 1 1 150px; }
.product-editor [hidden] { display: none; }
.stack { display: grid; gap: 15px; }
.stack.compact { gap: 10px; }
label { display: grid; gap: 7px; color: #3a4841; font-size: 12px; font-weight: 600; }
input, select, textarea { width: 100%; min-height: 41px; padding: 9px 11px; border: 1px solid #dfe5df; border-radius: 8px; outline: none; color: var(--ink); background: white; font: inherit; font-size: 13px; }
input:focus, select:focus, textarea:focus { border-color: #70a88a; box-shadow: 0 0 0 3px #3b8a6020; }
input:disabled { background: #f2f3f1; }
.hint { margin: 0; font-size: 11px; }
.inline-form { display: flex; align-items: end; gap: 10px; }
.inline-form label { min-width: 120px; }
.inline-form .button { flex-shrink: 0; }
.action-row { display: flex; align-items: end; flex-wrap: wrap; gap: 12px 20px; margin-top: 17px; }
.action-row .inline-form { gap: 8px; }
.action-row .inline-form label { min-width: 100px; }
.content-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.content-grid .card h2 { margin-bottom: 12px; }
.muted { color: var(--muted); font-size: 13px; }
.top-gap { margin-top: 12px; }
.compact-stats { grid-template-columns: repeat(2, minmax(0, 1fr)); max-width: 650px; margin-bottom: 24px; }
.inventory-banner { display: flex; justify-content: space-between; align-items: center; padding: 17px 20px; margin: 0 0 20px; border: 1px solid #dbe8de; border-radius: 12px; background: #edf4ee; }
.inventory-banner .eyebrow { margin: 0 0 4px; }
.inventory-banner strong { display: block; }
.hunger-card { margin-bottom: 28px; }
.hunger-number { display: flex; align-items: baseline; gap: 9px; }
.hunger-number strong { font: 800 32px Manrope, sans-serif; }
.hunger-number span { color: var(--muted); font-size: 13px; }
.meter-large { height: 12px; margin: 17px 0 10px; }
.hunger-card p { margin: 0; }
.property-actions { display: flex; align-items: end; gap: 12px; margin-top: 18px; }
.property-actions .stack { flex: 1; }
.property-actions .inline-form { align-items: end; }
.current-job { display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.current-job h2 { margin-bottom: 5px; }
.current-job p:last-child { margin-bottom: 0; }
.job-apply { display: grid; justify-items: end; gap: 12px; }
.loan-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; color: var(--ink); }
.loan-row p { margin: 6px 0 0; font-size: 12px; }
.table-wrap { overflow: auto; border: 1px solid var(--line); border-radius: 12px; background: white; }
table { width: 100%; border-collapse: collapse; text-align: left; }
th, td { padding: 14px 16px; border-bottom: 1px solid var(--line); font-size: 12px; white-space: nowrap; }
th { color: var(--muted); background: #fafbf9; font-weight: 600; }
tbody tr:last-child td { border-bottom: 0; }
.empty-state { padding: 28px; border: 1px dashed #d4ded5; border-radius: 12px; color: var(--muted); background: #fafbf9; text-align: center; font-size: 13px; }
.flash-list { display: grid; gap: 9px; margin: 0 0 18px; }
.flash { padding: 12px 15px; border: 1px solid; border-radius: 9px; font-size: 13px; }
.flash-success { color: #255f42; border-color: #c5e2ce; background: #edf7f0; }
.flash-error, .flash-warning { color: #863d34; border-color: #efc9c3; background: #fff1ee; }
.auth-layout { display: grid; min-height: 570px; grid-template-columns: 1.25fr .75fr; gap: 70px; align-items: center; }
.auth-intro { max-width: 590px; }
.auth-intro h1 { margin-bottom: 18px; font-size: clamp(40px, 6vw, 64px); }
.auth-intro h1 span { color: var(--green); }
.auth-intro > p:not(.eyebrow) { max-width: 470px; font-size: 16px; }
.auth-stats { display: flex; gap: 38px; margin-top: 35px; }
.auth-stats div { display: grid; gap: 4px; }
.auth-stats strong { font: 800 23px Manrope, sans-serif; }
.auth-stats span { color: var(--muted); font-size: 12px; }
.auth-card { padding: 30px; box-shadow: 0 12px 36px #24382b0b; }
.auth-card h2 { margin-bottom: 23px; font-size: 27px; }
.auth-switch { margin: 20px 0 0; font-size: 12px; text-align: center; }
.error-state { max-width: 540px; margin: 100px auto; text-align: center; }
.error-state p:not(.eyebrow) { margin-bottom: 24px; }
.back-link { display: inline-block; margin-bottom: 25px; font-size: 12px; font-weight: 700; }

@media (max-width: 820px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: repeat(2, 1fr); }
  .split-layout { grid-template-columns: 1fr; }
  .form-card { position: static; }
  .auth-layout { grid-template-columns: 1fr; gap: 25px; }
  .auth-intro { padding-top: 20px; }
}
@media (max-width: 560px) {
  .topbar { height: 60px; padding: 0 16px; }
  .top-account { gap: 9px; font-size: 12px; }
  .top-account .button { padding: 0 8px; }
  .nav-wrap { gap: 19px; padding: 0 16px; }
  .page { width: calc(100% - 32px); margin-top: 27px; }
  .hero { align-items: start; flex-direction: column; padding: 25px; }
  .stat-grid, .feature-grid, .content-grid, .compact-stats { grid-template-columns: 1fr 1fr; gap: 9px; }
  .stat-card { padding: 15px; }
  .stat-card strong { font-size: 20px; }
  .feature-card { padding: 16px; }
  .company-card, .card { padding: 16px; }
  .action-row, .property-actions { align-items: stretch; flex-direction: column; }
  .action-row .inline-form, .property-actions .inline-form { align-items: stretch; }
  .inline-form { flex-wrap: wrap; }
  .inline-form label { flex: 1; }
  .current-job { align-items: start; flex-direction: column; }
  .financial-grid { grid-template-columns: 1fr 1fr; }
  .inventory-banner { gap: 10px; }
  .auth-stats { gap: 24px; }
}
.search-form { margin: 12px 0 18px; flex-wrap: wrap; }
.search-form label { flex: 1 1 260px; }
.lease-row { display: flex; align-items: center; flex-wrap: wrap; gap: 10px 16px; padding: 12px 0; border-top: 1px solid var(--line); }
.lease-row form { margin-left: auto; }
.council-card { margin-bottom: 16px; }
.council-members { display: flex; flex-wrap: wrap; gap: 8px; }
.council-messages { display: grid; gap: 10px; max-height: 520px; overflow-y: auto; }
.council-message { padding: 12px 14px; border: 1px solid var(--line); border-radius: 10px; background: #fbfcfa; }
.council-message > div { display: flex; justify-content: space-between; gap: 12px; }
.council-message time { color: var(--muted); font-size: 11px; }
.council-message p { margin: 8px 0 0; white-space: pre-wrap; overflow-wrap: anywhere; }

.trade-marker { stroke: white; stroke-width: 2; }
.trade-buy { fill: #16834b; }
.trade-sell { fill: #c53b35; }
.chart-legend { font-size: 11px; color: var(--muted); }

.company-delete-choice { display: flex; align-items: center; gap: 12px; cursor: pointer; }
.company-delete-choice input[type="checkbox"] { width: 20px; min-height: 20px; height: 20px; flex: 0 0 20px; }

.casino-link { display: block; color: inherit; text-decoration: none; }
.casino-link:hover { border-color: var(--accent, #16834b); }
.casino-stage { text-align: center; overflow: hidden; }
.casino-wheel-wrap { position: relative; width: min(100%, 360px); aspect-ratio: 1; margin: 30px auto 24px; }
.casino-wheel { width: 100%; height: 100%; border: 8px solid #243a32; border-radius: 50%; background: conic-gradient(from -30deg, #247b52 0deg 60deg, #ac4741 60deg 120deg, #853c3a 120deg 180deg, #ac4741 180deg 240deg, #853c3a 240deg 300deg, #ac4741 300deg 360deg); position: relative; box-sizing: border-box; transition: transform 2.8s cubic-bezier(.12,.7,.16,1); }
.casino-wheel-label { position: absolute; top: 50%; left: 50%; width: 92px; margin-left: -46px; margin-top: -10px; color: white; font-size: clamp(10px, 2vw, 13px); font-weight: 700; transform: rotate(calc(var(--sector) * 60deg)) translateY(clamp(-115px, -23vw, -75px)); }
.casino-pointer { position: absolute; top: -12px; left: calc(50% - 14px); width: 0; height: 0; border-left: 14px solid transparent; border-right: 14px solid transparent; border-top: 28px solid #e7b34b; z-index: 2; }
.casino-wheel-hub { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; background: #fffaf0; color: #243a32; font-weight: 800; }
.casino-result { margin-top: 20px; padding: 16px; border: 1px solid currentColor; border-radius: 12px; }
@media (prefers-reduced-motion: reduce) { .casino-wheel { transition: none; } }
