/* ==========================================================================
   Aniiland — visual polish (loaded LAST, purely additive).
   One shared set of tokens so cards, buttons, inputs, dialogs and the header
   all feel like parts of the same product. Delete this file (and its <link>)
   to return to the previous look; nothing else depends on it.
   ========================================================================== */
:root {
  --pl-r-lg: 18px;   /* dialogs */
  --pl-r-md: 14px;   /* cards, panels */
  --pl-r-sm: 10px;   /* buttons, inputs, chips */
  --pl-line: #2c3e4e;
  --pl-line-strong: #3a4f61;
  --pl-surface: #111c27;       /* dialogs / deepest surfaces */
  --pl-card: #162330;          /* standard card */
  --pl-card-hi: #1b2b3a;       /* hovered / raised card */
  --pl-text: #eaf2f8;
  --pl-muted: #9eb0bf;
  --pl-accent: #9b74c7;
  --pl-accent-strong: #7851a9;
  --pl-focus: #c4a4ee;
  --pl-shadow-sm: 0 1px 2px rgba(3,9,15,.35), 0 4px 14px rgba(3,9,15,.22);
  --pl-shadow-lg: 0 24px 70px rgba(2,7,12,.6), 0 2px 8px rgba(2,7,12,.4);
  --pl-ease: .16s cubic-bezier(.2,.7,.3,1);
}

html { scroll-behavior: smooth; }
::selection { background: #7851a966; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition-duration: .01ms !important; animation-duration: .01ms !important; } }

/* ---------- Keyboard focus: one clear ring everywhere ---------- */
html :is(button, a, input, select, textarea, summary, [tabindex]):focus-visible {
  outline: 2px solid var(--pl-focus);
  outline-offset: 2px;
  border-radius: var(--pl-r-sm);
}

/* ---------- Thin, themed scrollbars ---------- */
* { scrollbar-width: thin; scrollbar-color: #3a4f61 transparent; }
*::-webkit-scrollbar { width: 10px; height: 10px; }
*::-webkit-scrollbar-thumb { background: #3a4f61; border-radius: 999px; border: 2px solid transparent; background-clip: content-box; }
*::-webkit-scrollbar-thumb:hover { background: #4d6579; background-clip: content-box; border: 2px solid transparent; }
*::-webkit-scrollbar-track { background: transparent; }

/* ---------- Cards & panels: same corner, same hairline, same lift ---------- */
html :is(
  .production-card, .flow-card, .upgrade-card, .metric, .food-strip, .homebuilding-card,
  .upgrade-planning-tools, .aniimo-needed-card, .worker-card, .roster-card, .used-aniimo-card,
  .component-card, .crafting-view-card, .order-card, .order-plan-card, .event-v2-card,
  .event-strategy-card, .power-setup-card, .potential-metric-card, .potential-improvement-card,
  .bonus-output-card, .advanced-facility-card, .event-mutation-card, .item-card,
  .owned-materials-panel, .material-cards > *, .access-strip
) {
  border-radius: var(--pl-r-md);
  transition: border-color var(--pl-ease), background-color var(--pl-ease), box-shadow var(--pl-ease), transform var(--pl-ease);
}
html :is(.production-card, .flow-card, .upgrade-card, .metric, .item-card, .order-card, .worker-card, .roster-card) {
  box-shadow: var(--pl-shadow-sm);
}
html :is(.item-card, .production-card, .flow-card):not(.locked):hover {
  border-color: var(--pl-accent);
  box-shadow: 0 6px 22px rgba(3,9,15,.35), 0 0 0 1px #9b74c733;
}
html .item-card { cursor: pointer; }
html .item-card:not(.locked):hover { transform: translateY(-2px); background-color: var(--pl-card-hi); }
html .item-card.locked { opacity: .72; }
html .item-card.locked:hover { opacity: .95; }

/* Smaller inner chips / rows */
html :is(.upgrade-part, .recipe-toggle-row, .climate-recipe-toggle, .owned-material-row, .family-pill, .aniimo-meta-pill) {
  border-radius: var(--pl-r-sm);
}

/* ---------- Section headings: consistent rhythm ---------- */
html .section-head {
  align-items: flex-end;
  gap: 12px 18px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--pl-line);
  margin-bottom: 16px;
}
html .section-head h2 { letter-spacing: -.01em; }
html main#content h1 { letter-spacing: -.02em; }

/* ---------- Buttons ---------- */
html :is(button.primary, .primary, button.secondary, .secondary) {
  border-radius: var(--pl-r-sm);
  transition: background-color var(--pl-ease), border-color var(--pl-ease), transform var(--pl-ease), box-shadow var(--pl-ease), filter var(--pl-ease);
}
html button.primary:not(:disabled):hover, html .primary:not(:disabled):hover {
  filter: brightness(1.1);
  box-shadow: 0 6px 20px rgba(120,81,169,.4);
}
html button.primary:not(:disabled):active, html .primary:not(:disabled):active,
html button.secondary:not(:disabled):active, html .secondary:not(:disabled):active { transform: translateY(1px); }
html :is(button.secondary, .secondary):not(:disabled):hover { border-color: var(--pl-accent); }
html :is(button:disabled, .primary:disabled) { cursor: not-allowed; }
html .segmented, html .segmented button { border-radius: var(--pl-r-sm); }
html .segmented { border-color: var(--pl-line); }

/* ---------- Form fields: one height, one radius, one caret ---------- */
html :is(select, input[type="text"], input[type="number"], input[type="search"], textarea) {
  border-radius: var(--pl-r-sm);
  border: 1px solid var(--pl-line-strong);
  background-color: #0f1b26;
  color: var(--pl-text);
  transition: border-color var(--pl-ease), box-shadow var(--pl-ease);
}
html :is(select, input[type="text"], input[type="number"], input[type="search"]) { min-height: 40px; }
html :is(select, input[type="text"], input[type="number"], input[type="search"], textarea):hover { border-color: #52697d; }
html :is(select, input[type="text"], input[type="number"], input[type="search"], textarea):focus {
  border-color: var(--pl-accent);
  box-shadow: 0 0 0 3px #9b74c733;
  outline: none;
}
html select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 36px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%239eb0bf' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
}
html select#level-value { padding-right: 28px; background-position: right 9px center; }
html select:disabled, html input:disabled { opacity: .55; }
html input[type="checkbox"] { accent-color: var(--pl-accent-strong); }
html input[type="range"] { accent-color: var(--pl-accent); }

/* ---------- Notes / callouts ---------- */
html .note { border-radius: var(--pl-r-sm); }
html :is(.note, .event-gold-note, .lock-dialog-note) :is(b, strong):first-child { margin-right: .35em; }

/* ---------- Dialogs: one shell, one header, one footer, one close button ---------- */
html dialog,
html dialog[class] {
  background: var(--pl-surface);
  color: var(--pl-text);
  border: 1px solid var(--pl-line-strong);
  border-radius: var(--pl-r-lg);
  box-shadow: var(--pl-shadow-lg);
}
html dialog::backdrop {
  background: rgba(3,9,15,.72);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
html dialog[open] { animation: pl-dialog-in .18s cubic-bezier(.2,.8,.3,1); }
@keyframes pl-dialog-in { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }

html :is(.advanced-setup-head, .event-dialog-head, .aniimo-needed-dialog-head, .feature-dialog-head, .event-v2-headbar) {
  background: #15222e;
  border-bottom: 1px solid var(--pl-line);
}
html :is(.advanced-setup-footer, .max-potential-footer, .event-guide-footer) {
  background: #0f1923;
  border-top: 1px solid var(--pl-line);
}
html :is(.advanced-setup-toolbar) { background: #101b25; border-bottom: 1px solid var(--pl-line); }

/* close buttons: neutral square, turns red only on hover */
html :is(.advanced-dialog-close, .event-dialog-close, .order-close, .dialog-close, dialog .close, dialog > .close) {
  display: inline-flex !important;
  align-items: center;
  justify-content: center;
  width: 36px !important;
  height: 36px !important;
  min-width: 36px !important;
  padding: 0 !important;
  font-size: 22px !important;
  line-height: 1 !important;
  color: #d3dfe9 !important;
  background: #ffffff0d !important;
  border: 1px solid var(--pl-line-strong) !important;
  border-radius: var(--pl-r-sm) !important;
  box-shadow: none !important;
  transition: background-color var(--pl-ease), border-color var(--pl-ease), color var(--pl-ease);
}
html :is(.advanced-dialog-close, .event-dialog-close, .order-close, .dialog-close, dialog .close):hover {
  background: #7a2d3d66 !important;
  border-color: #c25a6e !important;
  color: #fff !important;
}

/* dialog action rows: even spacing */
html :is(.advanced-setup-footer > div, .max-potential-footer > div, .lock-dialog-actions, .aniiland-update-actions) { gap: 10px; }

/* ---------- Header: one tidy row ---------- */
@media (min-width: 761px) {
  html:not(.aniiland-phone) body > header {
    flex-wrap: nowrap;
    gap: 14px;
    padding-inline: 24px;
    min-height: 76px;
    background: linear-gradient(180deg, #15222d 0%, #111b25 100%);
    border-bottom: 1px solid var(--pl-line);
  }
  html:not(.aniiland-phone) body > header nav {
    flex: 0 1 auto;
    min-width: 0;
    margin-left: auto;
    justify-content: flex-end;
    border-radius: var(--pl-r-md);
    background: #0d1720;
    border-color: var(--pl-line);
  }
  html:not(.aniiland-phone) body > header nav button { white-space: nowrap; padding-inline: 12px; border-radius: 10px; }
  html:not(.aniiland-phone) body > header .brand { flex: 0 0 auto; }
  html:not(.aniiland-phone) body > header .kofi-button { margin-left: 0; min-width: 0; flex: 0 0 auto; }
  html:not(.aniiland-phone) body > header .version { flex: 0 0 auto; }
  html:not(.aniiland-phone) body > header :is(.event-center-btn, .guide-open-btn) { flex: 0 0 auto; border-radius: var(--pl-r-md); }
}
/* under ~1500px, keep the tip button compact (icon only; label stays for screen readers) */
@media (min-width: 761px) and (max-width: 1499px) {
  html:not(.aniiland-phone) body > header .kofi-button { width: 38px; padding: 0; justify-content: center; }
  html:not(.aniiland-phone) body > header .kofi-button span { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
  html:not(.aniiland-phone) body > header .guide-open-btn span:last-child { display: none; }
}

/* ---------- Sidebar ---------- */
html .planner-sidebar .level-heading h2 { font-size: 20px; line-height: 1.15; white-space: nowrap; }
html .planner-sidebar :is(details.planner-settings-disclosure, .sidebar-dropdown) { border-radius: var(--pl-r-sm); border-color: var(--pl-line); transition: border-color var(--pl-ease), background-color var(--pl-ease); }
html .planner-sidebar details[open].planner-settings-disclosure { background: #ffffff05; border-color: var(--pl-line-strong); }
html .planner-sidebar summary { border-radius: var(--pl-r-sm); }
html .planner-sidebar .primary { border-radius: var(--pl-r-md); }

/* ---------- Floating bits (orders, quick links, toasts) ---------- */
html .order-panel { border-radius: var(--pl-r-md); border: 1px solid var(--pl-line-strong); box-shadow: var(--pl-shadow-lg); }
html .plan-quick-nav-inner { box-shadow: var(--pl-shadow-lg); backdrop-filter: blur(6px); }

/* ---------- Footer ---------- */
html .site-footer { border-top: 1px solid var(--pl-line); }

/* ---------- Phones ---------- */
@media (max-width: 760px) {
  html :is(select, input[type="text"], input[type="number"], input[type="search"]) { min-height: 44px; font-size: 16px; }
  html dialog[open] { animation-duration: .22s; }
  html :is(.advanced-dialog-close, .event-dialog-close, .order-close, .dialog-close, dialog .close) { width: 40px !important; height: 40px !important; min-width: 40px !important; }
}
html.aniiland-phone :is(select, input[type="text"], input[type="number"], input[type="search"]) { min-height: 44px; }

/* narrow desktops / small laptops: keep the header on one row */
@media (min-width: 761px) and (max-width: 1239px) {
  html:not(.aniiland-phone) body > header { gap: 8px; padding-inline: 14px; }
  html:not(.aniiland-phone) body > header nav { flex-wrap: nowrap; padding: 3px; gap: 2px; }
  html:not(.aniiland-phone) body > header nav button { padding: 9px 8px; font-size: 12.5px; }
  html:not(.aniiland-phone) body > header .brand small { display: none; }
  html:not(.aniiland-phone) body > header .event-center-btn { padding-inline: 8px; min-width: 0; }
  html:not(.aniiland-phone) body > header .event-center-btn small { display: none; }
  html:not(.aniiland-phone) body > header .version .version-details small { display: none; }
}

/* ==========================================================================
   PART 2 — systematic pass: type floor, pills, tables, cards, floor planner
   ========================================================================== */

/* ---------- Pills / chips: one shape, one size, readable ---------- */
html body :is(
  .production-use-tag, .recipe-use, .recipe-premium-tag, .recipe-event-tag, .legendary-tag, .prismana-tag,
  .recipe-module-note > span, .recipe-lock-btn, .family-pill, .aniimo-meta-pill, .muted-pill,
  .important-upgrade-badge, .aniimo-trait-level-badge, .aniimo-simple-any, .tag, .badge
) {
  display: inline-flex !important;
  align-items: center;
  gap: .35em;
  width: auto;
  max-width: 100%;
  padding: 3px 11px !important;
  border-radius: 999px !important;
  font-size: 12px !important;
  line-height: 1.35 !important;
  font-weight: 600 !important;
  letter-spacing: 0 !important;
  text-transform: none;
  text-align: left;
  white-space: normal;
  box-sizing: border-box;
}
html body .recipe-module-note { gap: 6px; display: flex; flex-wrap: wrap; align-items: center; font-size: 12px !important; }
html body .family-requirement { display: block; font-size: 12.5px !important; line-height: 1.5; text-align: left; }
html body .recipe-lock-btn { cursor: pointer; }
html body .recipe-lock-btn:hover { filter: brightness(1.15); }

/* ---------- Plan header: stat cards, next-RV card, planning tools ---------- */
html .metrics { gap: 16px; }
html .metric { padding: 20px 22px; }
html .metric > label { font-size: 12px; letter-spacing: .08em; opacity: .8; }
html .metric > small { font-size: 13px; line-height: 1.45; opacity: .85; }
html .upgrade-card { padding: 22px 24px; border-radius: var(--pl-r-md); }
html .upgrade-summary small { font-size: 13.5px; line-height: 1.5; }
html .upgrade-parts { gap: 12px; }
html .upgrade-part { padding: 12px 14px; border-radius: var(--pl-r-sm); }
html .upgrade-planning-tools {
  display: grid;
  grid-template-columns: minmax(180px, 1fr) auto;
  gap: 12px 24px;
  align-items: center;
  padding: 14px 16px;
}
html .upgrade-tool-actions { display: flex; flex-wrap: wrap; gap: 10px; justify-content: flex-end; }
html .mini-action {
  min-height: 38px;
  padding: 8px 14px;
  font-size: 13px;
  line-height: 1.25;
  border-radius: var(--pl-r-sm);
  white-space: nowrap;
  transition: background-color var(--pl-ease), border-color var(--pl-ease);
}
@media (max-width: 1180px) { html .upgrade-planning-tools { grid-template-columns: 1fr; } html .upgrade-tool-actions { justify-content: flex-start; } }
@media (max-width: 760px) { html .mini-action { white-space: normal; text-align: center; width: 100%; } }

/* ---------- Production cards (What to Grow & Gather) ---------- */
html .production-card h3 { font-size: 16px; }
html .production-card .product-row { padding: 16px 18px; gap: 16px; align-items: center; }
html .production-card .product-row > img { width: 48px; height: 48px; object-fit: contain; flex: none; }
html .production-card .product-row p { font-size: 13.5px; line-height: 1.5; }
html .production-card .product-row .qty { font-size: 14px; }
html .production-card .product-row > div { display: flex; flex-direction: column; align-items: flex-start; gap: 6px; min-width: 0; }
html .production-card .product-row > div > p { margin: 0; }

/* ---------- Production table (What to Produce) ---------- */
html .crafting-view-card table { width: 100%; border-collapse: separate; border-spacing: 0; table-layout: auto; }
html .crafting-view-card :is(th, td) { padding: 16px 18px; vertical-align: middle; }
html .crafting-view-card thead th { font-size: 12px; letter-spacing: .04em; white-space: nowrap; }
html .crafting-view-card tbody tr + tr td { border-top: 1px solid var(--pl-line); }
html .crafting-view-card tbody tr:hover td { background: #ffffff05; }
html .crafting-view-card td:nth-child(2) { min-width: 200px; line-height: 1.6; }
html .crafting-view-card td.num { white-space: nowrap; font-variant-numeric: tabular-nums; }
html .crafting-view-card td > .craft-product-facility { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 4px 16px; align-items: center; }
html .crafting-view-card .craft-facility-icon { width: 64px; height: 64px; display: grid; place-items: center; }
html .crafting-view-card .craft-facility-icon img { max-width: 64px; max-height: 64px; object-fit: contain; }
html .crafting-view-card .craft-product-info { display: flex; flex-direction: column; gap: 5px; min-width: 0; align-items: flex-start; }
html .crafting-view-card .craft-product-top { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px; }
html .crafting-view-card .craft-product-title { display: flex; align-items: center; gap: 8px; min-width: 0; }
html .crafting-view-card .craft-product-title > img { width: 26px; height: 26px; object-fit: contain; flex: none; }
html .crafting-view-card .craft-product-title .item-link {
  white-space: normal !important;
  overflow: visible !important;
  text-overflow: clip !important;
  max-width: none !important;
  text-align: left;
  font-size: 15px;
  line-height: 1.3;
}
html .crafting-view-card .craft-facility-name { font-size: 13px; color: var(--pl-muted); }
html .crafting-view-card td > .production-use-tag { margin: 10px 0 0 80px; }

/* ---------- Sell / seeds tables ---------- */
html :is(.flow-card, .flow-columns > div) table :is(th, td) { padding: 12px 14px; }
html :is(.flow-card) table td.num, html :is(.flow-card) table th.num { font-variant-numeric: tabular-nums; }
html .flow-card h3, html .production-card h3 { letter-spacing: -.005em; }

/* ---------- Aniimo needed: job rows stack, pets get real room ---------- */
html .aniimo-needed-card { padding: 20px 22px; }
html .aniimo-needed-jobs { display: flex; flex-direction: column; gap: 12px; }
html .aniimo-needed-job {
  display: flex !important;
  flex-direction: column !important;
  align-items: stretch !important;
  gap: 12px !important;
  padding: 14px 16px !important;
  border-radius: var(--pl-r-sm);
}
html .aniimo-needed-job-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 8px 12px; min-width: 0; }
html .aniimo-needed-job-info > b { font-size: 13.5px; line-height: 1.35; font-weight: 700; flex: 1 1 160px; min-width: 0; }
html .aniimo-simple-meta { display: inline-flex !important; gap: 6px; flex: none; }
html .aniimo-needed-card .aniimo-mini-list,
html .aniimo-needed-card .aniimo-mini-list.compact-worker-recommendation {
  display: grid !important;
  grid-template-columns: repeat(auto-fill, minmax(66px, 1fr)) !important;
  gap: 8px !important;
  margin: 0 !important;
  padding: 0 !important;
  overflow: visible !important;
  width: 100% !important;
}
html .aniimo-needed-card .aniimo-mini-list.compact-worker-recommendation > .aniimo-needed-pet,
html .aniimo-needed-card .aniimo-mini-list.compact-worker-recommendation .roster-assigned-instance {
  position: static !important;
  flex: none !important;
  width: auto !important;
  min-width: 0 !important;
  margin: 0 !important;
}
html .aniimo-needed-card .aniimo-needed-pet {
  display: flex !important;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 4px !important;
  width: auto !important;
  min-width: 0 !important;
  min-height: 0 !important;
  padding: 8px 4px 7px !important;
  border-radius: var(--pl-r-sm);
  overflow: hidden;
}
html .aniimo-needed-card .aniimo-needed-pet > img { width: 40px !important; height: 40px !important; }
html .aniimo-needed-card .aniimo-needed-pet > small {
  font-size: 11px !important;
  line-height: 1.2 !important;
  min-height: 0 !important;
  max-width: 100%;
  text-align: center;
  overflow-wrap: anywhere;
  hyphens: none;
}
html .worker-ability > b { letter-spacing: -.01em; }
html .aniimo-needed-card .worker-ability { padding-bottom: 10px; margin-bottom: 4px; }

/* ---------- Climate / power setup ---------- */
html .climate-grid { gap: 18px; align-items: start; }
html .climate-map { padding: 18px; border-radius: var(--pl-r-md); }
html .climate-map figcaption { font-size: 15px; font-weight: 700; padding-top: 12px; margin-top: 12px; }
html .climate-map.climate-void-map.climate-v1-map .climate-visual {
  grid-template-columns: minmax(0, 1fr) minmax(210px, 260px);
  gap: 16px;
}
html .climate-key { gap: 8px; }
html .climate-key-row { padding: 9px 12px; border-radius: var(--pl-r-sm); gap: 10px; align-items: center; }
html .climate-key-row b { font-size: 13px; line-height: 1.3; }
html .climate-key-row small { font-size: 12px; line-height: 1.35; }
html .climate-preview-scroll { border-radius: var(--pl-r-sm); }
html :is(.power-setup-card) { padding: 20px 22px; border-radius: var(--pl-r-md); }
html .power-setup-head b, html .power-setup-head strong { font-size: 16px; }
html .power-setup-rules { display: flex; flex-wrap: wrap; gap: 10px; }
html .power-setup-rules > * {
  flex: 0 1 auto;
  max-width: 100%;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 2px 6px;
  padding: 9px 14px;
  border-radius: var(--pl-r-sm);
  font-size: 13px;
  line-height: 1.5;
}
html :is(.climate-visual-toggle, .layout-toggle) { border-radius: var(--pl-r-sm); }

/* ---------- Floor planner page ---------- */
html .layout-legend { gap: 8px; }
html .layout-legend > div { padding: 8px 10px; border-radius: var(--pl-r-sm); }
html .layout-legend b { font-size: 13px; }
html .layout-legend small { font-size: 12px; }

/* ---------- Notes & banners ---------- */
html .note.crackle-plan-note { display: flex; flex-wrap: wrap; gap: 4px 8px; align-items: baseline; }
html .page-title { gap: 12px 20px; }
html .page-title .subtitle { font-size: 14.5px; max-width: 70ch; }

/* ---------- Catalog (Recipes & Items) ---------- */
html #catalog-grid { gap: 14px; }
html #catalog-grid .item-card { padding: 16px 12px 14px; gap: 6px; text-align: center; }
html #catalog-grid .item-card b { font-size: 14.5px; line-height: 1.3; }
html #catalog-grid .item-card small { font-size: 12.5px; line-height: 1.35; }

/* ---------- Order dock ---------- */
html .order-card { padding: 16px; gap: 12px; }

/* ---------- Footer & home block ---------- */
html .site-footer {
  display: flex !important;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 28px;
  padding: 20px 28px calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
  font-size: 13px;
  color: var(--pl-muted);
}
html .site-footer > span { display: inline-flex; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
html .site-footer a { color: #cfdbe5; text-decoration: none; }
html .site-footer a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
@media (min-width: 1100px) {
  html:not(.aniiland-phone) .home-about-inner { max-width: none; margin-left: 310px; padding: 40px 28px 34px 24px; }
}
@media (max-width: 760px) { html .site-footer { flex-direction: column; align-items: flex-start; } }

/* ---------- Phones: same system, thumb-friendly ---------- */
html.aniiland-phone .mobile-production-table .craft-product-title .item-link { white-space: normal !important; font-size: 15px; }
html.aniiland-phone .mobile-production-table .production-use-tag { margin: 10px 0 0 !important; }
html.aniiland-phone .flow-card table :is(th) { font-size: 11px; }
html.aniiland-phone .flow-card table :is(td) { font-size: 13.5px; }
html.aniiland-phone .flow-card table td img { width: 28px; height: 28px; }
html.aniiland-phone .aniimo-needed-card .aniimo-mini-list.compact-worker-recommendation { grid-template-columns: repeat(auto-fill, minmax(72px, 1fr)) !important; }
html.aniiland-phone .upgrade-card { padding: 18px; }
html.aniiland-phone .metric { padding: 16px 18px; }

/* climate maps: stack legend under the map when the card is narrow (stops the map being clipped) */
html .climate-map { container-type: inline-size; }
@container (max-width: 720px) {
  html .climate-map.climate-void-map.climate-v1-map .climate-visual { grid-template-columns: minmax(0, 1fr) !important; }
  html .climate-map .climate-key { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)) !important; }
}
html .crafting-view-card .craft-product-title { justify-content: flex-start !important; margin: 0 !important; width: auto !important; }
html .crafting-view-card .craft-product-title > img { margin: 0 !important; }
html .crafting-view-card .craft-product-top { justify-content: flex-start !important; text-align: left !important; }

/* footer: one tidy row (overrides the old stacked layout) */
html body .site-footer {
  flex-direction: row !important;
  align-items: center !important;
  justify-content: space-between !important;
  gap: 8px 28px !important;
  padding: 20px 28px calc(env(safe-area-inset-bottom, 0px) + 20px) !important;
}
html body .site-footer > span { display: inline-flex !important; flex-wrap: wrap; gap: 4px 10px; align-items: center; }
@media (max-width: 760px) { html body .site-footer { flex-direction: column !important; align-items: flex-start !important; } }

/* multi-line tags keep flowing text instead of splitting into flex columns */
html body .production-use-tag, html body .recipe-use { display: inline-block !important; border-radius: 14px !important; line-height: 1.4 !important; }
/* mobile production table: calm left-aligned rows and stat cells that never collide */
html.aniiland-phone .mobile-production-table td.num, html.aniiland-phone .mobile-production-table [class*="stat"] { overflow-wrap: anywhere; font-size: 14px; line-height: 1.35; }
html.aniiland-phone .mobile-production-table .craft-product-facility { display: grid !important; grid-template-columns: 56px minmax(0, 1fr); gap: 4px 12px; align-items: center; }
html.aniiland-phone .mobile-production-table .craft-product-info, html.aniiland-phone .mobile-production-table .craft-product-top, html.aniiland-phone .mobile-production-table .craft-product-title { align-items: flex-start !important; justify-content: flex-start !important; text-align: left !important; }
html.aniiland-phone .mobile-production-table td[data-label="Ingredients"] { line-height: 1.45 !important; min-width: 0 !important; }
html.aniiland-phone .mobile-production-table td[data-label="Ingredients"] > * { margin: 0; }
html .crafting-view-card .craft-product-title > img { align-self: center; }

/* ---- Minimum type size pass (12px floor) ---- */
html body .important-upgrade-badge{font-size:11px!important;padding:2px 8px!important;letter-spacing:.04em}
html body .game-localized-name{font-size:12px!important}
html body .brand small,html body header small,html body .site-header small{font-size:11px!important}
html body .worker-fill-label,html body .layout-quantity-max,html body .summary-count,
html body .plan-quick-nav-mark,html body button.secondary,html body .made-by,
html body .layout-status,html body .item-link,html body .site-footer a,html body .site-footer span{font-size:12px!important}
html body button.recipe-lock-btn{font-size:12px!important}
html body .mobile-production-table th{font-size:12px!important}
html body label.metric-label,html body .metric-card label{font-size:12px!important}
html body dialog small,html body dialog .muted,html body dialog [class*="sub"],html body dialog [class*="meta"]{font-size:12px!important}
/* order solver: same field styling for item + qty */
html body dialog input[type="text"],html body dialog input[type="search"],html body dialog input[type="number"],
html body .order-panel input,html body #order-panel input{background:var(--pl-surface)!important;color:#e8eef4!important;border:1px solid var(--pl-line-strong)!important;border-radius:var(--pl-r-sm)!important;min-height:40px;padding:0 12px}
html:not(#a):not(#b) body :is(.important-upgrade-badge,button.recipe-lock-btn,.mobile-production-table th,th.num,.metric-card label,.plan-quick-nav-toggle-icon){font-size:12px!important}
html:not(#a):not(#b) body :is(.important-upgrade-badge){font-size:11px!important}
html:not(#a):not(#b) body header small{font-size:11px!important}

html:not(#a):not(#b) body :is(.mobile-production-table th,table.data th){font-size:12px!important}
html:not(#a):not(#b) body .metric-card label,html:not(#a):not(#b) body label.metric-label{font-size:12px!important}

/* ---- RV level block ---- */
html body .planner-sidebar .eyebrow{margin:0 0 4px}
html body .planner-sidebar .level-heading{display:flex!important;align-items:center!important;justify-content:space-between!important;gap:12px!important;margin:0 0 12px!important}
html body .planner-sidebar .level-heading h2{font:700 19px/1.2 Manrope,sans-serif!important;color:var(--text,#eaf2f8);margin:0!important;white-space:nowrap}
html body .planner-sidebar select#level-value{
  appearance:none;-webkit-appearance:none;flex:none;width:76px!important;min-width:76px!important;height:46px;padding:0 22px 0 0!important;
  text-align:center;text-align-last:center;font:800 26px/1 Manrope,sans-serif!important;color:#9fd0f5!important;letter-spacing:-.01em;
  background-color:#0e1a26!important;border:1px solid var(--pl-line-strong)!important;border-radius:14px!important;cursor:pointer;
  background-image:url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2.5 4.5 6 8l3.5-3.5' fill='none' stroke='%238fa4b5' stroke-width='1.8' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E")!important;
  background-repeat:no-repeat!important;background-position:right 9px center!important;background-size:12px!important;transition:border-color .15s,box-shadow .15s}
html body .planner-sidebar select#level-value:hover{border-color:var(--pl-accent)!important}
html body .planner-sidebar select#level-value:focus-visible{box-shadow:0 0 0 3px #9b74c744!important;border-color:var(--pl-accent)!important}
/* slider with filled track */
html body input#level[type="range"]{-webkit-appearance:none;appearance:none;width:100%;height:22px;margin:0 0 14px;padding:0;background:transparent!important;border:0!important;cursor:pointer;--pct:0%}
html body input#level[type="range"]::-webkit-slider-runnable-track{height:6px;border-radius:999px;background:linear-gradient(90deg,var(--pl-accent-strong),var(--pl-accent)) 0/var(--pct) 100% no-repeat,#24364a}
html body input#level[type="range"]::-moz-range-track{height:6px;border-radius:999px;background:#24364a}
html body input#level[type="range"]::-moz-range-progress{height:6px;border-radius:999px;background:linear-gradient(90deg,var(--pl-accent-strong),var(--pl-accent))}
html body input#level[type="range"]::-webkit-slider-thumb{-webkit-appearance:none;width:20px;height:20px;margin-top:-7px;border-radius:50%;background:#f1e8fb;border:3px solid var(--pl-accent-strong);box-shadow:0 2px 8px #0008;transition:transform .12s}
html body input#level[type="range"]::-moz-range-thumb{width:14px;height:14px;border-radius:50%;background:#f1e8fb;border:3px solid var(--pl-accent-strong);box-shadow:0 2px 8px #0008}
html body input#level[type="range"]:hover::-webkit-slider-thumb{transform:scale(1.12)}
html body input#level[type="range"]:focus-visible{outline:none}
html body input#level[type="range"]:focus-visible::-webkit-slider-thumb{box-shadow:0 0 0 4px #9b74c755,0 2px 8px #0008}

/* footer: Made by Wintira link */
html body .site-footer .made-by{font-weight:700;color:var(--muted,#8fa4b5)}
html body .site-footer .made-by a{color:var(--text,#eaf2f8)!important;font-weight:800;text-decoration:none}
html body .site-footer .made-by a:hover{color:var(--pl-focus)!important;text-decoration:underline}
@media (max-width:760px){html body .site-footer{padding-bottom:calc(96px + env(safe-area-inset-bottom,0px))!important}}
html.aniiland-phone body footer.site-footer{padding-bottom:calc(92px + env(safe-area-inset-bottom,0px))!important}
