:root {
  --bg: #120f0c;
  --bg-deep: #0c0a08;
  --surface: #1d1814;
  --surface-2: #26201a;
  --surface-3: #302820;
  --well: #13100d;
  --ink: #f4ead7;
  --ink-soft: #b9a890;
  --ink-muted: #82735f;
  --border: rgba(232, 188, 122, 0.14);
  --border-strong: rgba(232, 188, 122, 0.32);
  --gold: #e7b44f;
  --gold-bright: #f7cf78;
  --gold-glow: rgba(231, 180, 79, 0.24);
  --leaf: #57a150;
  --leaf-deep: #346933;
  --dew: #5eb2d4;
  --glass: #69c79b;
  --rust: #d8624a;
  --rose: #d97a82;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  --shadow-sm: 0 6px 16px rgba(0, 0, 0, 0.32);
  --radius: 14px;
  --radius-sm: 10px;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100vh;
}

body {
  color: var(--ink);
  background:
    radial-gradient(1000px 440px at 50% -120px, rgba(231, 166, 74, 0.14), transparent 72%),
    radial-gradient(680px 360px at 100% 0%, rgba(94, 178, 212, 0.06), transparent 65%),
    linear-gradient(180deg, #171310 0%, var(--bg) 42%, var(--bg-deep) 100%);
  font-family: "Plus Jakarta Sans", "Segoe UI", system-ui, sans-serif;
  font-size: 14px;
  line-height: 1.45;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  margin: 0;
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink);
}

p { margin: 0; }

img, .pixel { image-rendering: pixelated; }

button, input, select {
  font: inherit;
  color: inherit;
}

button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  padding: 0.48rem 0.9rem;
  font-weight: 600;
  cursor: pointer;
  background: linear-gradient(180deg, #569b4e 0%, #3a7337 100%);
  color: #f9f4ea;
  border-color: rgba(145, 218, 128, 0.28);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.18), 0 3px 10px rgba(0, 0, 0, 0.28);
  transition: transform 0.08s ease, filter 0.12s ease, border-color 0.12s ease, background 0.12s ease;
}

button:hover:not(:disabled) { filter: brightness(1.09); }
button:active:not(:disabled) { transform: translateY(1px); }
button:disabled { opacity: 0.55; cursor: not-allowed; }

button.gold {
  background: linear-gradient(180deg, #e9b754 0%, #bd8526 100%);
  color: #1a1208;
  border-color: rgba(255, 232, 168, 0.48);
}

button.dew {
  background: linear-gradient(180deg, #4b9bc0 0%, #2d6f91 100%);
  color: #f2f9fc;
  border-color: rgba(148, 222, 255, 0.32);
}

button.danger {
  background: linear-gradient(180deg, #b94a36 0%, #863022 100%);
  color: #fdf3f0;
  border-color: rgba(255, 166, 148, 0.28);
}

button.quiet {
  background: rgba(255, 240, 214, 0.05);
  color: var(--ink-soft);
  border-color: var(--border);
  box-shadow: none;
}

button.quiet:hover:not(:disabled) {
  background: rgba(255, 240, 214, 0.1);
  color: var(--ink);
  border-color: var(--border-strong);
  filter: none;
}

button.quiet.active {
  background: rgba(231, 180, 79, 0.18);
  color: var(--gold-bright);
  border-color: rgba(231, 180, 79, 0.45);
}

button.small {
  padding: 0.34rem 0.65rem;
  font-size: 0.82rem;
  border-radius: 8px;
}

input, select {
  background: var(--well);
  color: var(--ink);
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 0.45rem 0.65rem;
  outline: none;
  transition: border-color 0.12s ease, box-shadow 0.12s ease;
}

input:focus, select:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(231, 180, 79, 0.16);
}

.num { font-variant-numeric: tabular-nums; }

/* ---------- Auth Gate ---------- */

.gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 1.5rem 1rem;
}

.gate-card {
  width: min(440px, 100%);
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.gate-hero {
  position: relative;
  height: 148px;
  overflow: hidden;
  background: #223426;
}

.gate-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.gate-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(18, 15, 12, 0.12) 0%, rgba(29, 24, 20, 0.96) 100%);
}

.gate-hero-title {
  position: absolute;
  left: 1.35rem;
  bottom: 0.85rem;
  z-index: 1;
}

.gate-hero-title h1 { font-size: 1.75rem; color: var(--gold-bright); }
.gate-hero-title p { color: var(--ink-soft); font-size: 0.9rem; margin-top: 0.15rem; }

.gate-form {
  padding: 1.15rem 1.35rem 1.35rem;
  display: grid;
  gap: 0.85rem;
}

.field-label {
  display: grid;
  gap: 0.3rem;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--ink-soft);
}

.gate-form input { width: 100%; }

.gate-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.65rem;
  margin-top: 0.25rem;
}

/* ---------- Main Shell & HUD ---------- */

.shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: 0.9rem 1rem 2rem;
  display: grid;
  gap: 0.85rem;
}

.hud {
  position: relative;
  border-radius: 16px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  overflow: hidden;
  box-shadow: var(--shadow);
}

.hud-art {
  position: absolute;
  inset: 0;
  background: url("/assets/farm_backdrop.png") center 38% / cover no-repeat;
  image-rendering: pixelated;
  opacity: 0.26;
  pointer-events: none;
}

.hud-art::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(22, 18, 14, 0.94) 0%, rgba(24, 19, 15, 0.8) 55%, rgba(22, 18, 14, 0.94) 100%);
}

.hud-top {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem 1rem;
  padding: 0.75rem 1rem;
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.7rem;
}

.portrait-frame {
  width: 48px;
  height: 48px;
  border-radius: 11px;
  background: var(--well);
  border: 1px solid rgba(231, 180, 79, 0.42);
  padding: 2px;
  flex: 0 0 auto;
  box-shadow: inset 0 2px 6px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.portrait-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 8px;
  display: block;
}

.brand h1 {
  font-size: 1.25rem;
  line-height: 1.1;
  color: var(--gold-bright);
}

.brand .farmer-tag {
  font-size: 0.8rem;
  color: var(--ink-soft);
  margin-top: 0.1rem;
}

.resources {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem;
}

.res-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: rgba(15, 12, 9, 0.72);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 0.28rem 0.65rem 0.28rem 0.4rem;
  font-weight: 600;
  font-size: 0.88rem;
  backdrop-filter: blur(4px);
}

.res-pill img {
  width: 22px;
  height: 22px;
  display: block;
}

.res-pill .res-label {
  color: var(--ink-muted);
  font-weight: 500;
  font-size: 0.76rem;
}

.stamina-pill {
  padding: 0.28rem 0.65rem;
  gap: 0.55rem;
}

.stamina-bar {
  width: 74px;
  height: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.stamina-bar > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #57a150, #a6d668);
  transition: width 0.25s ease;
}

.stamina-pill.low .stamina-bar > span {
  background: linear-gradient(90deg, #d8624a, #e7b44f);
}

.hud-actions {
  display: flex;
  align-items: center;
  gap: 0.45rem;
}

.hud-nav {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.5rem;
  padding: 0 0.85rem;
  background: rgba(12, 10, 8, 0.58);
  border-top: 1px solid var(--border);
}

.nav-tabs {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  flex-wrap: wrap;
}

.nav-tabs button {
  background: transparent;
  color: var(--ink-soft);
  border: 0;
  border-bottom: 2px solid transparent;
  border-radius: 0;
  padding: 0.62rem 0.9rem;
  box-shadow: none;
  font-size: 0.88rem;
}

.nav-tabs button:hover {
  color: var(--ink);
  background: rgba(255, 240, 214, 0.04);
  filter: none;
}

.nav-tabs button[aria-current="page"] {
  color: var(--gold-bright);
  border-bottom-color: var(--gold);
  background: linear-gradient(180deg, transparent 0%, rgba(231, 180, 79, 0.1) 100%);
}

.nav-clock {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.35rem 0;
  font-size: 0.8rem;
  color: var(--ink-soft);
}

.season-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.76rem;
  text-transform: capitalize;
  border: 1px solid transparent;
}

.season-tag.spring { background: rgba(105, 199, 130, 0.14); color: #9be0a9; border-color: rgba(105, 199, 130, 0.3); }
.season-tag.summer { background: rgba(231, 180, 79, 0.15); color: var(--gold-bright); border-color: rgba(231, 180, 79, 0.32); }
.season-tag.autumn { background: rgba(216, 121, 74, 0.16); color: #f1a97d; border-color: rgba(216, 121, 74, 0.32); }
.season-tag.winter { background: rgba(94, 178, 212, 0.16); color: #9ad8f0; border-color: rgba(94, 178, 212, 0.32); }

.weather-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.76rem;
  border: 1px solid transparent;
}
.weather-tag.rain { background: rgba(94, 178, 212, 0.16); color: #9ad8f0; border-color: rgba(94, 178, 212, 0.32); }
.weather-tag.heat { background: rgba(231, 140, 60, 0.16); color: #f0b27a; border-color: rgba(231, 140, 60, 0.34); }
.weather-tag.frost { background: rgba(170, 210, 240, 0.16); color: #c8e7f8; border-color: rgba(170, 210, 240, 0.34); }
.weather-tag.storm { background: rgba(130, 120, 180, 0.16); color: #c5bce8; border-color: rgba(130, 120, 180, 0.34); }

.event-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.76rem;
  border: 1px solid transparent;
  background: rgba(214, 168, 74, 0.16);
  color: #efd08a;
  border-color: rgba(214, 168, 74, 0.34);
}
.event-tag.planting_festival { background: rgba(87, 161, 80, 0.16); color: #a7e29f; border-color: rgba(87, 161, 80, 0.34); }
.event-tag.harvest_fair { background: rgba(231, 180, 79, 0.16); color: var(--gold-bright); border-color: rgba(231, 180, 79, 0.34); }
.event-tag.autumn_bazaar { background: rgba(216, 121, 74, 0.16); color: #f1a97d; border-color: rgba(216, 121, 74, 0.34); }
.event-tag.winter_rush { background: rgba(94, 178, 212, 0.16); color: #9ad8f0; border-color: rgba(94, 178, 212, 0.34); }

/* ---------- Paused & Notice Bars ---------- */

.hold {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.55rem 0.9rem;
  border-radius: 12px;
  background: rgba(231, 180, 79, 0.12);
  border: 1px solid rgba(231, 180, 79, 0.38);
  color: var(--gold-bright);
  font-size: 0.86rem;
}

.notice-bar {
  padding: 0.52rem 0.85rem;
  border-radius: 10px;
  font-size: 0.84rem;
  font-weight: 500;
  background: rgba(87, 161, 80, 0.13);
  border: 1px solid rgba(87, 161, 80, 0.35);
  color: #b4e8ab;
}

.notice-bar.bad {
  background: rgba(216, 98, 74, 0.15);
  border-color: rgba(216, 98, 74, 0.42);
  color: #f8b3a4;
}

/* ---------- Cards & Panels ---------- */

.card {
  background: linear-gradient(180deg, var(--surface-2) 0%, var(--surface) 100%);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm), inset 0 1px 0 rgba(255, 232, 196, 0.05);
}

.card-pad { padding: 1rem 1.1rem; }

/* ---------- Farm Two-Column Workspace ---------- */

.farm-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 0.9rem;
  align-items: start;
}

.board-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem 0.85rem;
  padding: 0.75rem 1rem;
  border-bottom: 1px solid var(--border);
}

.board-title {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.board-title h2 { font-size: 1.08rem; }

.board-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.22rem 0.58rem;
  border-radius: 999px;
  font-size: 0.76rem;
  font-weight: 600;
  background: rgba(255, 240, 214, 0.05);
  border: 1px solid var(--border);
  color: var(--ink-soft);
}

.chip img { width: 16px; height: 16px; display: block; }
.chip.good { background: rgba(87, 161, 80, 0.14); border-color: rgba(87, 161, 80, 0.34); color: #a7e29f; }
.chip.dew { background: rgba(94, 178, 212, 0.14); border-color: rgba(94, 178, 212, 0.34); color: #9ad8f0; }
.chip.warn { background: rgba(231, 180, 79, 0.15); border-color: rgba(231, 180, 79, 0.35); color: var(--gold-bright); }
.chip.bad { background: rgba(216, 98, 74, 0.16); border-color: rgba(216, 98, 74, 0.36); color: #f6b0a1; }
.chip.tone-bull { background: rgba(105, 199, 155, 0.14); border-color: rgba(105, 199, 155, 0.34); color: var(--glass); }
.chip.tone-bear { background: rgba(216, 98, 74, 0.14); border-color: rgba(216, 98, 74, 0.34); color: #f6b0a1; }
.chip.tone-flat { background: rgba(130, 115, 95, 0.16); border-color: rgba(130, 115, 95, 0.3); color: var(--ink-soft); }

.board-body { padding: 0.9rem; }

.season-banner {
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.7rem;
  border-radius: 9px;
  font-size: 0.8rem;
  color: #a6dcf2;
  background: rgba(94, 178, 212, 0.1);
  border: 1px solid rgba(94, 178, 212, 0.26);
}

.weather-banner.rain { color: #9ad8f0; background: rgba(94, 178, 212, 0.1); border-color: rgba(94, 178, 212, 0.26); }
.weather-banner.heat { color: #f0b27a; background: rgba(231, 140, 60, 0.1); border-color: rgba(231, 140, 60, 0.28); }
.weather-banner.frost { color: #c8e7f8; background: rgba(170, 210, 240, 0.1); border-color: rgba(170, 210, 240, 0.28); }
.weather-banner.storm { color: #c5bce8; background: rgba(130, 120, 180, 0.12); border-color: rgba(130, 120, 180, 0.28); }

.event-banner.planting_festival { color: #a7e29f; background: rgba(87, 161, 80, 0.1); border-color: rgba(87, 161, 80, 0.28); }
.event-banner.harvest_fair { color: var(--gold-bright); background: rgba(231, 180, 79, 0.1); border-color: rgba(231, 180, 79, 0.28); }
.event-banner.autumn_bazaar { color: #f1a97d; background: rgba(216, 121, 74, 0.1); border-color: rgba(216, 121, 74, 0.28); }
.event-banner.winter_rush { color: #9ad8f0; background: rgba(94, 178, 212, 0.1); border-color: rgba(94, 178, 212, 0.28); }

.chip.visit-S { background: rgba(231, 180, 79, 0.18); border-color: rgba(231, 180, 79, 0.4); color: var(--gold-bright); }
.chip.visit-A { background: rgba(87, 161, 80, 0.16); border-color: rgba(87, 161, 80, 0.36); color: #a7e29f; }
.chip.visit-B { background: rgba(94, 178, 212, 0.14); border-color: rgba(94, 178, 212, 0.34); color: #9ad8f0; }
.chip.visit-C,
.chip.visit-D,
.chip.visit-F { background: rgba(130, 115, 95, 0.16); border-color: rgba(130, 115, 95, 0.3); color: var(--ink-soft); }

.star-badge {
  font-size: 0.62rem;
  letter-spacing: -0.04em;
  color: var(--gold-bright);
  line-height: 1;
}
.star-badge.dim { opacity: 0.7; }

.risk-tag {
  display: inline-flex;
  align-items: center;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-weight: 600;
  font-size: 0.76rem;
  border: 1px solid transparent;
}
.risk-tag.wildlife_raid { background: rgba(216, 98, 74, 0.16); color: #f6b0a1; border-color: rgba(216, 98, 74, 0.36); }
.risk-tag.breakdown { background: rgba(130, 115, 95, 0.18); color: #d6c4a8; border-color: rgba(130, 115, 95, 0.34); }
.risk-tag.bumper_crop { background: rgba(87, 161, 80, 0.16); color: #a7e29f; border-color: rgba(87, 161, 80, 0.34); }

.risk-banner.wildlife_raid { color: #f6b0a1; background: rgba(216, 98, 74, 0.1); border-color: rgba(216, 98, 74, 0.28); }
.risk-banner.breakdown { color: #d6c4a8; background: rgba(130, 115, 95, 0.12); border-color: rgba(130, 115, 95, 0.28); }
.risk-banner.bumper_crop { color: #a7e29f; background: rgba(87, 161, 80, 0.1); border-color: rgba(87, 161, 80, 0.28); }

.plot-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.7rem;
}

.is-paused .plot-grid { filter: saturate(0.55) brightness(0.92); }

.plot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0.35rem;
  width: 100%;
  height: 178px;
  min-height: 178px;
  max-height: 178px;
  padding: 0.5rem 0.5rem 0.45rem;
  border-radius: 13px;
  background: linear-gradient(180deg, #28211b 0%, #191410 100%);
  border: 1px solid rgba(232, 188, 122, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 232, 196, 0.07), 0 6px 14px rgba(0, 0, 0, 0.3);
  color: var(--ink);
  font-weight: 500;
  text-align: center;
  overflow: hidden;
}

.plot:hover {
  border-color: rgba(231, 180, 79, 0.42);
  background: linear-gradient(180deg, #30271f 0%, #1e1813 100%);
  filter: none;
}

.plot.selected {
  border-color: var(--gold);
  box-shadow: 0 0 0 2px rgba(231, 180, 79, 0.32), 0 10px 20px rgba(0, 0, 0, 0.42);
  background: linear-gradient(180deg, #34291f 0%, #211a13 100%);
}

.plot.ready {
  border-color: rgba(247, 207, 120, 0.65);
  box-shadow: 0 0 18px rgba(231, 180, 79, 0.18), inset 0 1px 0 rgba(255, 232, 168, 0.2);
}

.plot.ready.selected {
  box-shadow: 0 0 0 2px rgba(231, 180, 79, 0.45), 0 0 22px rgba(231, 180, 79, 0.26);
}

.plot.greenhouse {
  border-color: rgba(105, 199, 155, 0.38);
}

.plot.aquaculture {
  background: linear-gradient(160deg, #1a2a33, #121c22);
  border-color: rgba(94, 178, 212, 0.35);
}
.plot.building,
.plot.processing,
.plot.kitchen,
.plot.specialty,
.plot.animal,
.plot.storage,
.plot.retail,
.plot.empty {
  background: linear-gradient(180deg, #2a241c 0%, #1a1510 100%);
  border-color: rgba(232, 188, 122, 0.22);
}
.plot.retail {
  border-color: rgba(214, 154, 92, 0.4);
}
.plot.building .plot-name,
.plot.processing .plot-name,
.plot.kitchen .plot-name,
.plot.specialty .plot-name,
.plot.animal .plot-name,
.plot.storage .plot-name,
.plot.retail .plot-name,
.plot.aquaculture .plot-name {
  color: var(--ink);
  font-weight: 700;
}
.retail-sell-actions {
  display: flex;
  flex-direction: column;
  gap: 0.25rem;
  align-items: stretch;
}
.retail-offer {
  align-items: center;
}
.plot.barn {
  border-color: rgba(216, 134, 86, 0.35);
}

.plot.pasture {
  border-color: rgba(139, 196, 102, 0.35);
}

.plot-top {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.25rem;
  font-size: 0.72rem;
}

.slot-num {
  color: var(--ink-muted);
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plot-badges {
  display: flex;
  align-items: center;
  gap: 3px;
}

.plot-badges img {
  width: 15px;
  height: 15px;
  display: block;
}

.pip-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: inline-block;
}

.pip-dot.ready { background: var(--gold-bright); box-shadow: 0 0 7px var(--gold); }
.pip-dot.wet { background: var(--dew); }
.pip-dot.dry { background: #b78d57; }
.pip-dot.weed { background: #89b94f; }
.pip-dot.bad { background: var(--rust); }

.tile-art {
  position: relative;
  width: 76px;
  height: 76px;
  flex: 0 0 auto;
  border-radius: 9px;
  overflow: hidden;
  background: var(--well);
  border: 2px solid #0e0b09;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.45);
}

.plot.greenhouse .tile-art {
  border-color: rgba(105, 199, 155, 0.55);
}

.plot.greenhouse .tile-art::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: linear-gradient(135deg, rgba(178, 245, 222, 0.24) 0%, transparent 45%, rgba(178, 245, 222, 0.12) 100%);
}

.tile-art .soil,
.tile-art .crop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.tile-art .soil { object-fit: cover; }

.tile-art .crop {
  z-index: 1;
  padding: 9px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
}

.plot.withered .crop {
  filter: grayscale(0.9) brightness(0.65) drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

.field-herd {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 1px;
  padding: 4px;
}

.field-herd img {
  width: 30px;
  height: 30px;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.6));
}

.plot-caption {
  width: 100%;
  display: grid;
  gap: 2px;
  flex: 0 0 auto;
  min-height: 2.2rem;
}

.plot-name {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--ink);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.15;
}

.plot-sub {
  font-size: 0.7rem;
  color: var(--ink-muted);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.2;
  min-height: 0.84rem;
}

.plot.ready .plot-sub { color: var(--gold-bright); font-weight: 600; }
.plot.withered .plot-sub { color: var(--rust); font-weight: 600; }

.plot-bars {
  width: 100%;
  display: grid;
  gap: 3px;
  flex: 0 0 auto;
  min-height: 15px;
  margin-top: auto;
}

.meter {
  display: block;
  width: 100%;
  height: 6px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.45);
  overflow: hidden;
}

.meter.ghost {
  visibility: hidden;
}

.meter > span {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #cf9430, #f5cd71);
  transition: width 0.25s linear;
}

.meter.work > span {
  background: linear-gradient(90deg, #52a44c, #b5e67c);
}

.meter.day {
  width: 84px;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
}

.plot-expand {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  height: 178px;
  min-height: 178px;
  max-height: 178px;
  padding: 0.75rem;
  border-radius: 13px;
  background: rgba(255, 240, 214, 0.025);
  border: 1px dashed rgba(231, 180, 79, 0.34);
  color: var(--ink-soft);
  box-shadow: none;
}

.plot-expand:hover {
  background: rgba(231, 180, 79, 0.08);
  border-color: var(--gold);
  color: var(--gold-bright);
  filter: none;
}

.plot-expand .plus {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-size: 1.25rem;
  font-weight: 400;
  background: rgba(231, 180, 79, 0.12);
  color: var(--gold-bright);
}

.plot-expand .expand-cost {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  font-size: 0.8rem;
  color: var(--gold-bright);
}

.plot-expand .expand-cost img { width: 16px; height: 16px; }

.board-hint {
  margin-top: 0.75rem;
  font-size: 0.76rem;
  color: var(--ink-muted);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 0.4rem;
}

/* ---------- Plot Inspector (Right Column) ---------- */

.side-stack {
  position: sticky;
  top: 0.9rem;
  display: grid;
  gap: 0.8rem;
}

.inspector {
  overflow: hidden;
}

.q-badge {
  padding: 0.08rem 0.36rem;
  border-radius: 999px;
  background: rgba(231, 180, 79, 0.2);
  border: 1px solid rgba(231, 180, 79, 0.45);
  color: var(--gold-bright);
  font-size: 0.66rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.plot.has-queue {
  border-color: rgba(231, 180, 79, 0.42);
}

.slot-queue-note {
  padding: 0.48rem 0.65rem;
  border-radius: 9px;
  background: rgba(231, 180, 79, 0.08);
  border: 1px solid rgba(231, 180, 79, 0.26);
  display: grid;
  gap: 0.2rem;
}

.queue-card {
  overflow: hidden;
}

.queue-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.72rem 0.95rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
}

.queue-title,
.queue-head-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.queue-title h3 { font-size: 0.96rem; }

.queue-list {
  padding: 0.65rem 0.8rem;
  display: grid;
  gap: 0.48rem;
  max-height: 290px;
  overflow-y: auto;
}

.queue-item {
  display: grid;
  gap: 0.42rem;
  padding: 0.5rem 0.6rem;
  border-radius: 10px;
  background: rgba(14, 11, 8, 0.55);
  border: 1px solid var(--border);
}

.queue-item.active {
  border-color: rgba(87, 161, 80, 0.46);
  background: rgba(87, 161, 80, 0.09);
}

.queue-item-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.queue-item-left {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  min-width: 0;
}

.queue-item-left img { width: 22px; height: 22px; flex: 0 0 auto; }

.queue-pos {
  font-size: 0.66rem;
  font-weight: 700;
  padding: 0.14rem 0.38rem;
  border-radius: 6px;
  background: rgba(255, 240, 214, 0.07);
  color: var(--ink-soft);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.queue-pos.now {
  background: rgba(87, 161, 80, 0.22);
  color: #a7e29f;
}

.queue-info {
  min-width: 0;
  display: grid;
}

.queue-info strong {
  font-size: 0.82rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.queue-info > span {
  font-size: 0.72rem;
  color: var(--ink-muted);
}

.queue-x {
  padding: 0.18rem 0.48rem;
  font-size: 0.92rem;
  line-height: 1;
}

.insp-head {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.16);
}

.insp-thumb {
  position: relative;
  width: 54px;
  height: 54px;
  border-radius: 10px;
  overflow: hidden;
  background: var(--well);
  border: 1px solid var(--border-strong);
  flex: 0 0 auto;
}

.insp-thumb img.soil { width: 100%; height: 100%; object-fit: cover; display: block; }
.insp-thumb img.crop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 6px;
}

.insp-head h2 { font-size: 1.05rem; }
.insp-head .insp-role { font-size: 0.8rem; color: var(--ink-soft); margin-top: 0.1rem; }

.insp-body {
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.85rem;
}

.insp-section {
  display: grid;
  gap: 0.5rem;
}

.section-kicker {
  font-size: 0.72rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
}

.seed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.45rem;
}

.seed-btn {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  justify-content: flex-start;
  padding: 0.45rem 0.55rem;
  background: rgba(255, 240, 214, 0.05);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.seed-btn:hover:not(:disabled) {
  background: rgba(87, 161, 80, 0.16);
  border-color: rgba(87, 161, 80, 0.5);
  filter: none;
}

.seed-btn img { width: 26px; height: 26px; flex: 0 0 auto; }
.seed-btn .seed-info { min-width: 0; display: grid; }
.seed-btn .seed-name { font-size: 0.82rem; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.seed-btn .seed-qty { font-size: 0.72rem; color: var(--ink-muted); }

.action-stack {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.action-stack button img { width: 18px; height: 18px; }

.upgrade-list {
  display: grid;
  gap: 0.45rem;
}

.upgrade-btn {
  width: 100%;
  justify-content: space-between;
  padding: 0.5rem 0.65rem;
  background: rgba(15, 12, 9, 0.55);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
}

.upgrade-btn:hover:not(:disabled) {
  background: rgba(231, 180, 79, 0.1);
  border-color: rgba(231, 180, 79, 0.45);
  filter: none;
}

.upgrade-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.upgrade-left img { width: 26px; height: 26px; border-radius: 5px; flex: 0 0 auto; }
.upgrade-title { font-size: 0.84rem; font-weight: 600; display: block; }
.upgrade-note { font-size: 0.72rem; color: var(--ink-muted); font-weight: 400; display: block; }

.price-tag {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--gold-bright);
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
}

.price-tag img { width: 16px; height: 16px; }

.animal-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.48rem 0.6rem;
  border-radius: 10px;
  background: rgba(15, 12, 9, 0.55);
  border: 1px solid var(--border);
}

.animal-row-left {
  display: flex;
  align-items: center;
  gap: 0.55rem;
}

.animal-row-left img { width: 28px; height: 28px; }
.animal-status { font-size: 0.75rem; color: var(--ink-muted); display: block; }
.animal-status.hungry { color: var(--rust); font-weight: 600; }

.gh-form {
  display: flex;
  gap: 0.45rem;
  align-items: center;
}

.gh-form select { flex: 1; min-width: 0; }

.muted-note { font-size: 0.8rem; color: var(--ink-soft); }

/* ---------- Workers Tab ---------- */

.crew-page {
  display: grid;
  gap: 0.85rem;
  min-width: 0;
  width: 100%;
  max-width: 100%;
}

.crew-summary {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.7rem;
  min-width: 0;
}

.kpi-card {
  padding: 0.85rem 0.95rem;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.7rem;
  min-width: 0;
}

.kpi-copy {
  min-width: 0;
  flex: 1;
}

.kpi-hire {
  flex-wrap: wrap;
  align-items: center;
}

.kpi-hire button {
  width: 100%;
  justify-content: center;
}

.kpi-label {
  font-size: 0.72rem;
  text-transform: uppercase;
  letter-spacing: 0.07em;
  color: var(--ink-muted);
  font-weight: 700;
}

.kpi-val {
  font-family: "Bitter", Georgia, serif;
  font-size: 1.45rem;
  font-weight: 700;
  color: var(--ink);
  line-height: 1.15;
  margin-top: 0.15rem;
}

.kpi-sub {
  font-size: 0.76rem;
  color: var(--ink-soft);
  margin-top: 0.28rem;
  line-height: 1.35;
}

.crew-jobs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.45rem;
}

.crew-section-head {
  display: grid;
  gap: 0.2rem;
  min-width: 0;
  margin-top: 0.15rem;
}

.crew-section-head h2 { font-size: 1.1rem; }
.crew-section-head p {
  font-size: 0.8rem;
  color: var(--ink-muted);
  line-height: 1.4;
  max-width: 42rem;
}

.hands-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.8rem;
  min-width: 0;
}

.crew-card {
  padding: 0.9rem;
  display: grid;
  gap: 0.75rem;
  min-width: 0;
  overflow: hidden;
}

.crew-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
  min-width: 0;
}

.crew-id {
  display: flex;
  align-items: flex-start;
  gap: 0.7rem;
  min-width: 0;
  flex: 1;
}

.crew-portrait {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
}

.crew-id-text {
  min-width: 0;
  flex: 1;
  display: grid;
  gap: 0.28rem;
}

.crew-name-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  min-width: 0;
}

.crew-name-row h3 {
  font-size: 1.05rem;
  line-height: 1.2;
  min-width: 0;
  overflow-wrap: anywhere;
}

.crew-detail {
  font-size: 0.76rem;
  color: var(--ink-soft);
  line-height: 1.35;
}

.crew-fire { flex-shrink: 0; }

.crew-bond,
.crew-hours {
  display: grid;
  gap: 0.28rem;
  min-width: 0;
}

.crew-bond {
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.crew-hours-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
  font-size: 0.76rem;
  color: var(--ink-soft);
}

.crew-hours-top strong {
  color: var(--gold-bright);
  font-size: 0.84rem;
}

.crew-meter {
  display: block;
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.crew-meter > span {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--gold), var(--gold-bright));
}

.crew-bond .crew-meter > span {
  background: linear-gradient(90deg, var(--rose), var(--gold));
}

.crew-wage-banner {
  padding: 0.9rem 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  flex-wrap: wrap;
  min-width: 0;
}

.crew-wage-banner.owed {
  border-color: rgba(224, 122, 95, 0.55);
  background: rgba(224, 122, 95, 0.08);
}

.crew-wage-copy {
  min-width: 0;
  flex: 1;
}

.crew-level {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  flex-wrap: wrap;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(14, 11, 8, 0.45);
  border: 1px solid var(--border);
}

.crew-level-copy {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
  font-size: 0.78rem;
  color: var(--ink-soft);
}

.crew-wage {
  color: var(--gold-bright);
  font-weight: 600;
}

.crew-card.unpaid {
  border-color: rgba(224, 122, 95, 0.4);
}

.crew-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
  min-width: 0;
}

.crew-stats-wide {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.crew-stat {
  display: grid;
  gap: 0.35rem;
  padding: 0.55rem 0.55rem 0.6rem;
  border-radius: 10px;
  background: rgba(14, 11, 8, 0.6);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  min-width: 0;
  width: 100%;
}

button.crew-stat:hover {
  background: rgba(231, 180, 79, 0.1);
  border-color: rgba(231, 180, 79, 0.5);
  filter: none;
}

.crew-stat-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  font-size: 0.76rem;
  font-weight: 600;
  min-width: 0;
}

.crew-stat-top span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-stat-top strong {
  color: var(--gold-bright);
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}

.crew-skills {
  display: grid;
  gap: 0.4rem;
  min-width: 0;
}

.crew-skill {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 0.55rem;
  padding: 0.55rem 0.65rem;
  border-radius: 10px;
  background: rgba(14, 11, 8, 0.52);
  border: 1px solid var(--border);
  color: var(--ink);
  box-shadow: none;
  text-align: left;
  min-width: 0;
  width: 100%;
}

.crew-skill.locked { opacity: 0.72; }
.crew-skill.learned {
  border-color: rgba(105, 199, 155, 0.28);
  background: rgba(105, 199, 155, 0.06);
}
.crew-skill.mastered {
  border-color: rgba(105, 199, 155, 0.4);
}

button.crew-skill:hover {
  opacity: 1;
  border-color: rgba(105, 199, 155, 0.65);
  background: rgba(105, 199, 155, 0.13);
  filter: none;
}

.crew-skill-icon {
  width: 28px;
  height: 28px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  display: grid;
  place-items: center;
  flex-shrink: 0;
}

.crew-skill-icon img {
  width: 18px;
  height: 18px;
}

.crew-skill-body {
  min-width: 0;
  display: grid;
  gap: 0.28rem;
}

.crew-skill-name {
  font-size: 0.82rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.crew-skill .crew-meter > span {
  background: linear-gradient(90deg, #3f8f6c, var(--glass));
}

.crew-skill-state {
  font-size: 0.7rem;
  color: var(--ink-muted);
  white-space: nowrap;
  flex-shrink: 0;
}

.crew-skill.mastered .crew-skill-state {
  color: var(--glass);
  font-weight: 600;
}

/* ---------- Market Exchange Tab ---------- */

.exchange-shell {
  display: grid;
  gap: 0.8rem;
}

.exchange-top {
  padding: 0.85rem 1rem;
  display: grid;
  gap: 0.7rem;
}

.ex-controls {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.55rem;
}

.ex-search-wrap {
  flex: 1 1 240px;
  min-width: 180px;
}

.ex-search-wrap input {
  width: 100%;
  padding: 0.45rem 0.75rem;
}

.ex-price-range {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: var(--ink-muted);
}

.ex-price-range input {
  width: 5.1rem;
  padding: 0.42rem 0.5rem;
  font-variant-numeric: tabular-nums;
}

.ex-bar-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
}

.ex-tabs,
.ex-bulk,
.ex-cat-pills {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.tab-ct {
  opacity: 0.72;
  font-size: 0.76rem;
}

.ex-cats {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding-top: 0.55rem;
  border-top: 1px solid var(--border);
}

.ex-table-card {
  overflow: hidden;
}

.ex-table-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.65rem 1rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
}

.ex-size-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.ex-size-pick select {
  padding: 0.25rem 0.45rem;
  font-size: 0.78rem;
}

.ex-head-row,
.ex-row {
  display: grid;
  grid-template-columns: minmax(220px, 1.45fr) 64px minmax(150px, 0.95fr) minmax(260px, 1.35fr);
  align-items: center;
  gap: 0.7rem;
  padding: 0.55rem 1rem;
}

.ex-head-row {
  font-size: 0.7rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.22);
}

.ex-rows {
  display: grid;
}

.ex-row {
  border-bottom: 1px solid rgba(232, 188, 122, 0.08);
  transition: background 0.1s ease;
}

.ex-row:last-child { border-bottom: 0; }
.ex-row:hover { background: rgba(255, 240, 214, 0.03); }

.ex-item {
  display: flex;
  align-items: center;
  gap: 0.55rem;
  min-width: 0;
}

.star-btn {
  width: 28px;
  height: 28px;
  padding: 0;
  border-radius: 7px;
  background: transparent;
  border: 1px solid transparent;
  box-shadow: none;
  color: var(--ink-muted);
  font-size: 1rem;
  flex: 0 0 auto;
}

.star-btn:hover {
  background: rgba(231, 180, 79, 0.1);
  color: var(--gold-bright);
  filter: none;
}

.star-btn.on { color: var(--gold-bright); }

.hold-btn {
  min-width: 38px;
  height: 28px;
  padding: 0 0.35rem;
  border-radius: 7px;
  background: transparent;
  border: 1px solid rgba(180, 140, 90, 0.35);
  box-shadow: none;
  color: var(--ink-muted);
  font-size: 0.62rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  flex: 0 0 auto;
  line-height: 1;
}

.hold-btn:hover {
  background: rgba(196, 96, 72, 0.12);
  color: #d4785c;
  filter: none;
}

.hold-btn.on {
  border-color: rgba(196, 96, 72, 0.55);
  background: rgba(196, 96, 72, 0.16);
  color: #e08a6e;
}

.item-id {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.item-well {
  width: 38px;
  height: 38px;
  border-radius: 9px;
  background: var(--well);
  border: 1px solid var(--border);
  display: grid;
  place-items: center;
  flex: 0 0 auto;
}

.item-well img { width: 28px; height: 28px; object-fit: contain; }

.ex-name-wrap { min-width: 0; }

.ex-name-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.35rem;
}

.tiny-chip {
  padding: 0.08rem 0.42rem;
  font-size: 0.68rem;
}

.small-chip {
  padding: 0.1rem 0.48rem;
  font-size: 0.7rem;
  box-shadow: none;
}

.tick-name-btn {
  padding: 0;
  border: 0;
  background: none;
  box-shadow: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
  display: inline-flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.4rem;
  text-align: left;
}

.tick-name-btn:hover {
  filter: none;
  color: var(--gold-bright);
}

.tick-symbol {
  font-family: "Bitter", Georgia, serif;
  font-weight: 700;
  letter-spacing: 0.06em;
  font-size: 0.78rem;
  color: var(--gold);
  font-variant-numeric: tabular-nums;
}

.ex-quote {
  display: grid;
  justify-items: start;
  gap: 0.18rem;
  min-width: 0;
}

.tick-change {
  font-size: 0.78rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

.tick-change.tone-bull,
.chip.tone-bull { color: var(--glass); }
.tick-change.tone-bear,
.chip.tone-bear { color: var(--rust); }
.tick-change.tone-flat,
.chip.tone-flat { color: var(--ink-soft); }

.tick-spark {
  display: block;
  color: var(--ink-muted);
}

.tick-spark.tone-bull { color: var(--glass); }
.tick-spark.tone-bear { color: var(--rust); }
.tick-spark.tone-flat { color: var(--dew); }

.tick-spark-fill {
  fill: currentColor;
  opacity: 0.16;
}

.tick-spark-line { opacity: 0.95; }

.tick-modal .tick-quote {
  display: grid;
  gap: 0.55rem;
  margin-bottom: 0.85rem;
}

.tick-symbol-row {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 0.15rem;
}

.tick-last {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 0.65rem;
}

.tick-last-price {
  font-family: "Bitter", Georgia, serif;
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  font-variant-numeric: tabular-nums;
}

.tick-quote-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.tick-chart-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(180deg, rgba(94, 178, 212, 0.05), transparent 42%),
    rgba(0, 0, 0, 0.22);
  padding: 0.55rem 0.55rem 0.35rem;
  margin-bottom: 0.85rem;
}

.tick-chart {
  display: block;
  width: 100%;
  height: auto;
}

.tick-chart-line {
  stroke: var(--dew);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
}

.tick-chart-fill {
  fill: rgba(94, 178, 212, 0.16);
}

.tick-chart-grid {
  stroke: rgba(232, 188, 122, 0.1);
  stroke-width: 1;
}

.tick-chart-axis {
  fill: var(--ink-muted);
  font-size: 9px;
  font-family: "Plus Jakarta Sans", sans-serif;
}

.tick-sale-dot {
  fill: var(--gold-bright);
  stroke: #1a140f;
  stroke-width: 1;
}

.tick-chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.35rem 0.25rem 0.15rem;
  color: var(--ink-muted);
  font-size: 0.75rem;
}

.tick-chart-legend i {
  display: inline-block;
  width: 12px;
  height: 8px;
  margin-right: 0.3rem;
  vertical-align: middle;
  border-radius: 2px;
}

.leg-line { background: var(--dew); }
.leg-sale { background: var(--gold-bright); border-radius: 50%; width: 8px; height: 8px; }

.tick-pressure {
  display: grid;
  gap: 0.35rem;
  margin-bottom: 0.9rem;
}

.tick-pressure-label {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  align-items: baseline;
}

.tick-pressure-track {
  position: relative;
  height: 10px;
  border-radius: 999px;
  background: linear-gradient(90deg, rgba(105, 199, 155, 0.35), rgba(130, 115, 95, 0.25) 50%, rgba(216, 98, 74, 0.4));
  border: 1px solid var(--border);
}

.tick-pressure-mid {
  position: absolute;
  left: 50%;
  top: -2px;
  bottom: -2px;
  width: 1px;
  background: rgba(244, 234, 215, 0.45);
}

.tick-pressure-fill {
  position: absolute;
  top: -3px;
  width: 12px;
  height: 14px;
  margin-left: -6px;
  border-radius: 3px;
  background: var(--ink);
  border: 1px solid var(--gold);
  box-shadow: var(--shadow-sm);
}

.tick-pressure-ends {
  display: flex;
  justify-content: space-between;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
}

.tick-tape {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: rgba(0, 0, 0, 0.18);
}

.tick-tape-head {
  display: flex;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.45rem 0.7rem;
  border-bottom: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.2);
}

.tick-tape-list {
  max-height: 220px;
  overflow: auto;
}

.tick-tape-row {
  display: grid;
  grid-template-columns: 78px 72px 58px 70px 1fr;
  gap: 0.45rem;
  align-items: center;
  padding: 0.38rem 0.7rem;
  border-bottom: 1px solid rgba(232, 188, 122, 0.07);
  font-size: 0.78rem;
}

.tick-tape-row:last-child { border-bottom: 0; }

.tick-tape-note {
  font-weight: 700;
  letter-spacing: 0.04em;
  font-size: 0.68rem;
  color: var(--ink-soft);
}

.tick-tape-note.sale { color: var(--gold-bright); }
.tick-tape-note.daily,
.tick-tape-note.backfill { color: var(--dew); }

@media (max-width: 900px) {
  .ex-head-row,
  .ex-row {
    grid-template-columns: 1fr;
    gap: 0.4rem;
  }
  .tick-tape-row {
    grid-template-columns: 70px 1fr;
  }
}

.ex-owned {
  font-size: 0.85rem;
  color: var(--ink-muted);
}

.ex-owned.has {
  color: var(--gold-bright);
  font-weight: 700;
}

.ex-trade {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.35rem;
  flex-wrap: wrap;
}

.qty-group {
  display: inline-flex;
  align-items: center;
  gap: 0.25rem;
}

.ex-trade input {
  width: 4.2rem;
  padding: 0.3rem 0.4rem;
  text-align: center;
  font-variant-numeric: tabular-nums;
}

.ex-empty {
  padding: 2rem 1rem;
  text-align: center;
}

.ex-pager {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  padding: 0.7rem 1rem;
  border-top: 1px solid var(--border);
  background: rgba(0, 0, 0, 0.14);
}

.ex-page-btns {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.3rem;
}

.modal-wide {
  width: min(500px, 100%);
}

.modal-sched {
  width: min(560px, 100%);
}

.modal-craft-recipes {
  width: min(540px, 100%);
}

.craft-recipe-list {
  display: grid;
  gap: 0.35rem;
  max-height: min(52vh, 420px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.craft-recipe-list .craft-recipe-row {
  width: 100%;
}

.m-panel {
  display: grid;
  gap: 0.6rem;
  padding: 0.85rem 0.9rem;
  border-radius: 12px;
  background: rgba(14, 11, 8, 0.58);
  border: 1px solid var(--border);
}

.preset-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.buyto-row {
  display: flex;
  align-items: flex-end;
  gap: 0.6rem;
}

.autobuy-fields {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.check-row {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.84rem;
  color: var(--ink-soft);
  cursor: pointer;
}

.check-row input[type="checkbox"] {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--gold);
}

/* ---------- Bag Tab ---------- */

.bag-wrap {
  display: grid;
  gap: 0.9rem;
}

.bag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 0.65rem;
}

.bag-slot {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.45rem;
  padding: 0.85rem 0.6rem 0.7rem;
  border-radius: 12px;
  background: rgba(14, 11, 8, 0.6);
  border: 1px solid var(--border);
  text-align: center;
}

.bag-slot .item-well { width: 52px; height: 52px; }
.bag-slot .item-well img { width: 38px; height: 38px; }
.bag-slot strong { font-size: 0.82rem; font-weight: 600; color: var(--ink); }

.qty-badge {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 0.12rem 0.45rem;
  border-radius: 999px;
  background: rgba(231, 180, 79, 0.16);
  border: 1px solid rgba(231, 180, 79, 0.36);
  color: var(--gold-bright);
  font-size: 0.72rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* ---------- Almanac Tab ---------- */

.almanac-tabs {
  margin-bottom: 0.15rem;
}

.almanac-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  margin-top: 0.35rem;
}

.almanac-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.75rem;
}

.crop-entry {
  padding: 0.9rem;
  display: grid;
  gap: 0.7rem;
}

.crop-entry-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
}

.crop-entry-head h3 { font-size: 1.02rem; }

.stage-strip {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr;
  align-items: center;
  gap: 0.3rem;
  padding: 0.55rem;
  border-radius: 10px;
  background: var(--well);
  border: 1px solid var(--border);
}

.stage-cell {
  display: grid;
  place-items: center;
  gap: 0.2rem;
}

.stage-cell img { width: 32px; height: 32px; object-fit: contain; }
.stage-cell span { font-size: 0.66rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.stage-arrow { color: var(--ink-muted); font-size: 0.85rem; }

.crop-stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.4rem;
}

.crop-stat {
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  background: rgba(255, 240, 214, 0.035);
  border: 1px solid var(--border);
}

.crop-stat span { display: block; font-size: 0.67rem; color: var(--ink-muted); text-transform: uppercase; letter-spacing: 0.05em; }
.crop-stat strong { display: block; font-size: 0.84rem; margin-top: 0.1rem; font-variant-numeric: tabular-nums; }

/* ---------- Modal ---------- */

.modal-back {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 1rem;
  background: rgba(8, 6, 4, 0.74);
  backdrop-filter: blur(5px);
}

.modal {
  width: min(440px, 100%);
  max-height: calc(100vh - 2rem);
  overflow-y: auto;
  background: linear-gradient(180deg, #27201a 0%, #1a1511 100%);
  border: 1px solid rgba(231, 180, 79, 0.42);
  border-radius: 16px;
  padding: 1.15rem 1.25rem;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.65);
  display: grid;
  gap: 0.75rem;
}

.modal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.modal-head h2 { font-size: 1.2rem; color: var(--gold-bright); }
.modal-detail { color: var(--ink-soft); font-size: 0.9rem; }

.pay-choices {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.6rem;
}

.pay-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  padding: 0.75rem 0.65rem;
  border-radius: 12px;
}

.pay-card img { width: 24px; height: 24px; }
.pay-card .pay-amt { font-size: 0.98rem; font-weight: 700; font-variant-numeric: tabular-nums; }
.pay-card .pay-sub { font-size: 0.74rem; opacity: 0.88; }
.pay-card.short { opacity: 0.55; }

.modal-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding-top: 0.35rem;
  border-top: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--ink-muted);
}

/* ---------- Soil Nutrients & Rotation Schedule ---------- */

.rot-badge {
  padding: 0.06rem 0.32rem;
  border-radius: 999px;
  background: rgba(87, 161, 80, 0.22);
  border: 1px solid rgba(105, 199, 155, 0.5);
  color: #a7e29f;
  font-size: 0.64rem;
  font-weight: 700;
}

.nut-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem;
}

.nut-box {
  padding: 0.4rem 0.5rem;
  border-radius: 9px;
  background: rgba(14, 11, 8, 0.58);
  border: 1px solid var(--border);
  display: grid;
  gap: 0.25rem;
}

.nut-box.low {
  border-color: rgba(216, 98, 74, 0.48);
  background: rgba(216, 98, 74, 0.08);
}

.nut-top {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.nut-box.low .nut-top strong { color: #f6b0a1; }

.nut-bar {
  display: block;
  width: 100%;
  height: 5px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
}

.nut-bar > span {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #c9a15a, #e7b44f);
}
.nut-bar.nut-n > span { background: linear-gradient(90deg, #4f9e4c, #8fd674); }
.nut-bar.nut-p > span { background: linear-gradient(90deg, #d8983b, #f3cb73); }
.nut-bar.nut-k > span { background: linear-gradient(90deg, #5ba4cf, #98d8f0); }
.nut-bar.nut-dry > span { background: linear-gradient(90deg, #c9a15a, #e7b44f); }
.nut-bar.nut-cold > span { background: linear-gradient(90deg, #5ba4cf, #98d8f0); }
.nut-box.low .nut-bar > span { background: linear-gradient(90deg, #b94a36, #ef8b74); }

.soil-lock {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.55rem;
  padding: 0.48rem 0.6rem;
  border-radius: 9px;
  background: rgba(255, 240, 214, 0.03);
  border: 1px dashed var(--border-strong);
}

.soil-lock button { flex-shrink: 0; }

.treat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.4rem;
}

.treat-locked { opacity: 0.52; }

.seed-btn.rot-good {
  border-color: rgba(105, 199, 155, 0.42);
}

.rot-chain {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.25rem;
}

.rot-pill {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.2rem 0.45rem;
  border-radius: 8px;
  background: rgba(14, 11, 8, 0.62);
  border: 1px solid var(--border);
  font-size: 0.74rem;
}

.rot-pill.next {
  border-color: var(--gold);
  background: rgba(231, 180, 79, 0.14);
  color: var(--gold-bright);
  font-weight: 600;
}

.rot-pill img { width: 16px; height: 16px; }
.rot-arrow { color: var(--ink-muted); font-size: 0.75rem; }

.sched-cycle-panel,
.sched-picker-panel {
  gap: 0.55rem;
}

.sched-steps {
  display: grid;
  gap: 0.35rem;
  max-height: 168px;
  overflow-y: auto;
}

.sched-step {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  padding: 0.38rem 0.55rem;
  border-radius: 9px;
  background: rgba(255, 240, 214, 0.04);
  border: 1px solid var(--border);
}

.sched-step-left {
  display: flex;
  align-items: center;
  gap: 0.45rem;
  min-width: 0;
}

.sched-step-left > span:last-child {
  display: grid;
  min-width: 0;
}

.sched-step-left img { width: 22px; height: 22px; flex: 0 0 auto; }
.sched-step-btns { display: flex; gap: 0.25rem; flex: 0 0 auto; }

.sched-analysis {
  display: grid;
  gap: 0.2rem;
  padding: 0.48rem 0.65rem;
  border-radius: 9px;
  font-size: 0.78rem;
}

.sched-analysis.good {
  background: rgba(87, 161, 80, 0.12);
  border: 1px solid rgba(87, 161, 80, 0.34);
  color: #b4e8ab;
}

.sched-analysis.warn {
  background: rgba(231, 180, 79, 0.12);
  border: 1px solid rgba(231, 180, 79, 0.36);
  color: var(--gold-bright);
}

.sched-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  max-height: 4.6rem;
  overflow-y: auto;
  padding-bottom: 0.1rem;
}

.sched-picker {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.35rem;
  max-height: min(38vh, 320px);
  overflow-y: auto;
  padding-right: 0.15rem;
}

.sched-picker .seed-btn {
  width: 100%;
}

@media (min-width: 560px) {
  .sched-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.copy-targets {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
}

.almanac-soil {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  font-size: 0.74rem;
  color: var(--ink-soft);
}

.good-txt { color: #a7e29f; font-weight: 600; }

/* ---------- Tractors & Implements Page ---------- */

.fleet-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.85rem;
}

.fleet-card {
  padding: 0.95rem 1rem;
  display: grid;
  gap: 0.75rem;
}

.fleet-card.is-busy,
.imp-unit.is-busy {
  border-color: rgba(231, 180, 79, 0.48);
  box-shadow: 0 0 18px rgba(231, 180, 79, 0.1);
}

.fleet-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.65rem;
}

.fleet-card-head h3 { font-size: 1.02rem; }
.fleet-well { width: 46px; height: 46px; }
.fleet-well img { width: 34px; height: 34px; }

.fleet-assign {
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.fleet-assign select { width: 100%; }

.imp-owned-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.65rem;
}

.imp-unit {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.65rem;
  padding: 0.68rem 0.8rem;
}

.imp-unit button { flex-shrink: 0; }

.dealership-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  align-items: start;
}

.dealer-list {
  padding: 0.75rem;
  display: grid;
  gap: 0.55rem;
}

.dealer-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  padding: 0.65rem 0.75rem;
  border-radius: 11px;
  background: rgba(14, 11, 8, 0.55);
  border: 1px solid var(--border);
}

.dealer-row button { flex-shrink: 0; white-space: nowrap; }

/* ---------- Responsive ---------- */

@media (max-width: 920px) {
  .farm-layout { grid-template-columns: 1fr; }
  .side-stack { position: static; }
  .crew-summary { grid-template-columns: 1fr; }
  .hands-grid { grid-template-columns: 1fr; }
  .fleet-grid, .imp-owned-grid, .dealership-grid { grid-template-columns: 1fr; }
  .ex-head-row { display: none; }
  .ex-row { grid-template-columns: 1fr auto; gap: 0.5rem; }
  .ex-actions { grid-column: 1 / -1; }
  .ex-trade { justify-content: flex-start; }
  .almanac-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 600px) {
  .plot-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .autobuy-fields { grid-template-columns: 1fr; }
  .buyto-row { flex-direction: column; align-items: stretch; }
  .almanac-grid { grid-template-columns: 1fr; }
  .crew-card { padding: 0.8rem; gap: 0.65rem; }
  .crew-stats,
  .crew-stats-wide { gap: 0.35rem; }
  .crew-stat { padding: 0.5rem 0.45rem; }
  .crew-stat-top { font-size: 0.72rem; }
  .crew-skill { padding: 0.5rem 0.55rem; gap: 0.45rem; }
  .crew-skill-state { font-size: 0.66rem; }
  .crew-wage-banner { padding: 0.8rem; }
}
