:root {
  color-scheme: light;
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  color: #344339;
  background: #bac59b;
  font-synthesis: none;
  --lw-cream: #fffaf0;
  --lw-paper: #f6f0e3;
  --lw-moss: #405d46;
  --lw-deep: #2e4836;
  --lw-muted: #798174;
  --lw-line: #e1e2d1;
  --lw-rust: #b86344;
  --lw-shadow: 0 12px 40px #253c3420, 0 2px 8px #253c3410;
  --lw-dock-bottom: max(12px, env(safe-area-inset-bottom));
  --lw-panel-bottom: calc(var(--lw-dock-bottom) + 84px);
}

* { box-sizing: border-box; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
body { overscroll-behavior: none; }
#zoo { position: fixed; inset: 0; display: block; width: 100%; height: 100%; touch-action: none; outline: none; }
#ui { position: fixed; inset: 0; z-index: 2; pointer-events: none; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; cursor: pointer; }
button:disabled { cursor: default; }
button, input { touch-action: manipulation; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #c8794b; outline-offset: 3px; }
[hidden] { display: none !important; }
.lw-shell { position: absolute; inset: 0; }
.lw-shell button, .lw-shell input, .lw-sheet, .lw-placement, .lw-dialog { pointer-events: auto; }
.lw-shell h2, .lw-shell h3, .lw-shell p { margin: 0; }
.lw-shell h2, .lw-dialog h2 { font-family: Georgia, 'Times New Roman', serif; font-weight: 500; letter-spacing: -.04em; }
.lw-shell h3 { font-size: 14px; font-weight: 650; letter-spacing: -.02em; }
.lw-shell p { line-height: 1.5; }
.lw-grow { flex: 1; min-width: 0; }
.lw-muted { color: var(--lw-muted); }
.lw-symbol { color: var(--lw-moss); font-size: 23px; line-height: 1; flex-shrink: 0; }
.lw-eyebrow { display: block; color: var(--lw-rust); font-size: 10px; font-weight: 750; letter-spacing: .11em; line-height: 1.5; text-transform: uppercase; }

/* A light, compact header lets the park do most of the talking. */
.lw-top-stack { position: absolute; top: max(15px, env(safe-area-inset-top)); left: 20px; width: min(420px, calc(100% - 40px)); display: flex; flex-direction: column; gap: 10px; }
.lw-hud { pointer-events: auto; padding: 13px 15px 8px; border: 1px solid #fffdf4b8; border-radius: 22px; background: #fffaf0ed; box-shadow: var(--lw-shadow); backdrop-filter: blur(12px); }
.lw-hud-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.lw-wordmark { display: flex; align-items: center; gap: 8px; padding: 0; border: 0; background: none; color: var(--lw-deep); text-align: left; flex-shrink: 0; }
.lw-wordmark strong { display: block; font-family: Georgia, 'Times New Roman', serif; font-size: 26px; font-weight: 500; letter-spacing: -.055em; line-height: 1; }
.lw-wordmark small { display: block; margin-top: 4px; color: #7c8474; font-size: 9px; letter-spacing: .015em; }
.lw-brand-flower { color: var(--lw-rust); font-size: 33px; }
.lw-time-controls { display: flex; align-items: center; gap: 5px; }
.lw-day { margin-right: 3px; color: #78816f; font-size: 10px; font-weight: 650; white-space: nowrap; }
.lw-round-button { display: inline-flex; width: 40px; min-width: 40px; height: 44px; align-items: center; justify-content: center; border: 1px solid #4b67431a; border-radius: 50%; background: #f6f3e8; color: var(--lw-moss); font-size: 19px; font-weight: 650; line-height: 1; box-shadow: 0 1px 2px #304b3510; }
.lw-round-button:hover { background: #e9eddc; }
.lw-round-button:disabled { opacity: .55; cursor: default; }
.lw-round-button:active { transform: translateY(1px); }
.lw-round-button[data-paused='true'] { background: var(--lw-moss); color: var(--lw-cream); font-size: 15px; }
.lw-speed { width: 40px; min-width: 40px; font-size: 13px; }
.lw-help-button { font-family: Georgia, 'Times New Roman', serif; font-size: 18px; }
.lw-hud-metrics { display: grid; grid-template-columns: 1.15fr 1fr 1fr; margin-top: 13px; padding-top: 10px; border-top: 1px solid #d9decc; }
.lw-metric { display: flex; flex-direction: column; align-items: center; gap: 1px; min-height: 45px; padding: 0 8px; border: 0; border-right: 1px solid #dfe2d3; background: none; color: var(--lw-deep); }
.lw-metric:last-child { border-right: 0; }
.lw-metric-value { font-family: Georgia, 'Times New Roman', serif; font-size: 22px; font-weight: 500; font-variant-numeric: tabular-nums; letter-spacing: -.05em; }
.lw-metric-label { color: #7b8374; font-size: 10px; line-height: 1.4; }
.lw-save-status { min-height: 15px; margin-top: 5px !important; color: #7d8677; font-size: 10px; text-align: center; overflow-wrap: anywhere; }
.lw-save-status[data-warning='true'] { padding: 5px 6px; color: #8b482f; border-radius: 6px; background: #f5e2d4; font-weight: 650; }
.lw-goal-peek { display: flex; align-items: center; align-self: flex-start; gap: 11px; max-width: 365px; padding: 12px 14px; border: 1px solid #fffdf2bd; border-radius: 15px; background: #fffaf0e8; box-shadow: 0 4px 18px #34493912; text-align: left; color: #4e624b; backdrop-filter: blur(8px); }
.lw-goal-star { color: #b78248; font-size: 21px; }
.lw-goal-copy { flex: 1; }
.lw-goal-copy small { display: block; margin-bottom: 4px; color: #8b907b; font-size: 9px; font-weight: 700; text-transform: uppercase; letter-spacing: .085em; }
.lw-goal-label { display: block; font-size: 12px; line-height: 1.4; }
.lw-goal-progress { color: #949a87; font-size: 10px; font-variant-numeric: tabular-nums; }
.lw-notice { pointer-events: auto; align-self: flex-start; max-width: 100%; padding: 11px 14px; border: 1px solid #c7d6bb; border-radius: 12px; background: #f9fbedf5; color: #415b39; box-shadow: 0 4px 12px #304b3514; font-size: 12px; line-height: 1.45; overflow-wrap: anywhere; }
.lw-notice[data-tone='error'] { border-color: #ddc0a9; background: #fff2e5f5; color: #894b32; }
.lw-notice[data-tone='success'] { border-color: #bbd0a7; background: #edf5e5f5; }

/* Persistent world controls and large, labeled tools. */
.lw-dock { display: flex; position: absolute; left: 50%; bottom: var(--lw-dock-bottom); width: min(426px, calc(100% - 30px)); padding: 7px; transform: translateX(-50%); gap: 4px; border: 1px solid #fffaf4c4; border-radius: 22px; background: #fffaf0f5; box-shadow: var(--lw-shadow); backdrop-filter: blur(14px); }
.lw-dock-button { display: flex; flex: 1; align-items: center; justify-content: center; flex-direction: column; gap: 4px; min-height: 57px; padding: 4px 8px; border: 0; border-radius: 16px; background: transparent; color: #707d69; font-size: 10px; font-weight: 650; }
.lw-dock-icon { color: inherit; font-family: Georgia, 'Times New Roman', serif; font-size: 24px; line-height: 25px; }
.lw-dock-button:hover { background: #eaf0df; color: var(--lw-moss); }
.lw-dock-button[data-active='true'] { background: var(--lw-moss); color: #fffbef; box-shadow: 0 3px 5px #304b3520; }
.lw-undo { flex: .65; border-left: 1px solid #e4e5d8; border-radius: 0 16px 16px 0; }
.lw-undo:disabled { opacity: .35; background: transparent; }
.lw-world-controls { position: absolute; right: 22px; bottom: calc(var(--lw-panel-bottom) + 3px); display: flex; flex-direction: column; gap: 8px; }
.lw-world-controls .lw-round-button { width: 44px; height: 44px; background: #fffaf0ed; font-size: 24px; box-shadow: 0 3px 10px #304b3518; }

/* Sheets always collapse back to the world; their body, not the page, scrolls. */
.lw-sheet { position: absolute; bottom: var(--lw-panel-bottom); left: 50%; width: min(572px, calc(100% - 30px)); max-height: min(590px, calc(100dvh - 225px)); transform: translateX(-50%); display: flex; flex-direction: column; overflow: hidden; border: 1px solid #fffdf5; border-radius: 23px; background: #fffaf1fa; box-shadow: var(--lw-shadow); backdrop-filter: blur(18px); }
.lw-sheet-header { display: flex; align-items: center; justify-content: space-between; flex-shrink: 0; gap: 15px; padding: 19px 21px 14px; border-bottom: 1px solid #e7e6d8; }
.lw-sheet-header h2 { margin-top: 3px; color: var(--lw-deep); font-size: 27px; line-height: 1.1; overflow-wrap: anywhere; }
.lw-collapse { flex-shrink: 0; width: 44px; height: 44px; font-size: 25px; }
.lw-sheet-body { min-height: 0; padding: 18px 21px 23px; overflow-y: auto; overscroll-behavior: contain; scrollbar-width: thin; scrollbar-color: #c5cdb6 transparent; }
.lw-panel-intro { margin-bottom: 20px !important; color: #7b8271; font-size: 12px; }
.lw-panel-section + .lw-panel-section { margin-top: 23px; }
.lw-panel-section { margin-bottom: 20px; }
.lw-panel-section:last-child { margin-bottom: 0; }
.lw-section-heading { margin-bottom: 11px; }
.lw-section-heading h3 { color: #435c42; }
.lw-section-heading p { margin-top: 4px; color: #8a8e7d; font-size: 11px; line-height: 1.45; }
.lw-small-note { margin-top: 10px !important; color: #858b78; font-size: 11px; line-height: 1.5; }
.lw-empty-note { padding: 15px; border-radius: 12px; background: #f0f0e2; color: #7d8671; font-size: 12px; }
.lw-button { display: inline-flex; align-items: center; justify-content: center; gap: 7px; min-height: 44px; max-width: 100%; padding: 11px 16px; border: 1px solid transparent; border-radius: 12px; font-size: 12px; font-weight: 650; line-height: 1.3; text-align: center; }
.lw-button:active { transform: translateY(1px); }
.lw-primary { border-color: var(--lw-moss); background: var(--lw-moss); color: #fffaf0; box-shadow: 0 3px 7px #29452f14; }
.lw-primary:hover { background: #344e39; }
.lw-secondary { border-color: #d8dfc8; background: #eaf0df; color: #4d6647; }
.lw-secondary:hover { background: #dce8cc; }
.lw-button:disabled { opacity: .43; transform: none; box-shadow: none; }
.lw-text-button { padding-left: 0; padding-right: 0; background: none; color: #7c876e; font-size: 11px; }
.lw-text-button:hover { color: #3b593a; text-decoration: underline; text-underline-offset: 4px; }
.lw-danger-text { color: #a47053; }
.lw-button-row { display: flex; gap: 10px; flex-wrap: wrap; }
.lw-button-row > .lw-button { flex: 1; }

/* Construction catalogue and transactional placement. */
.lw-build-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lw-build-card { display: flex; align-items: flex-start; gap: 11px; min-height: 100px; padding: 14px 12px; border: 1px solid #e0e3d1; border-radius: 14px; background: #faf9ed; color: #496145; text-align: left; }
.lw-build-card:hover { background: #f0f3e2; border-color: #bfcca8; }
.lw-build-card:active { background: #e8efda; }
.lw-build-symbol { display: flex; align-items: center; justify-content: center; width: 35px; height: 36px; flex-shrink: 0; border-radius: 9px; background: #e8eddc; color: #799567; font-size: 25px; }
.lw-build-card-copy { min-width: 0; }
.lw-build-card strong { display: block; font-size: 12px; line-height: 1.25; }
.lw-build-card small { display: block; margin-top: 4px; color: #8a8e79; font-size: 10px; line-height: 1.35; }
.lw-price-tag { display: inline-block; margin-top: 8px; color: #a07849; font-size: 10px; font-weight: 650; }
.lw-placement { position: absolute; left: 50%; bottom: var(--lw-panel-bottom); width: min(445px, calc(100% - 30px)); padding: 17px 19px; transform: translateX(-50%); border: 1px solid #fffdf2; border-radius: 20px; background: #fffaf0f5; box-shadow: var(--lw-shadow); backdrop-filter: blur(12px); }
.lw-placement-heading { display: flex; align-items: center; gap: 8px; }
.lw-placement-heading > .lw-symbol { color: #b78a55; font-size: 19px; }
.lw-placement-title { font-family: Georgia, 'Times New Roman', serif; font-size: 20px; font-weight: 500; letter-spacing: -.03em; }
.lw-paused-note { margin-left: auto; padding: 4px 7px; border-radius: 5px; background: #ece8d7; color: #8b8d77; font-size: 9px; white-space: nowrap; }
.lw-placement-hint { margin-top: 7px !important; color: #838873; font-size: 11px; }
.lw-dimensions { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 12px; }
.lw-dimension { display: flex; align-items: center; gap: 8px; }
.lw-dimension > span { color: #80886f; font-size: 10px; }
.lw-stepper { display: flex; flex: 1; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid #dfe3d0; border-radius: 9px; background: #f9f9ed; }
.lw-stepper strong { min-width: 12px; color: #506347; font-size: 12px; text-align: center; font-variant-numeric: tabular-nums; }
.lw-step-button { display: inline-flex; align-items: center; justify-content: center; width: 44px; min-width: 40px; height: 44px; padding: 0; border: 0; border-radius: 8px; background: none; color: #677f53; font-size: 18px; }
.lw-step-button:hover { background: #e5eed7; }
.lw-step-button:disabled { opacity: .3; }
.lw-placement-status { min-height: 31px; margin-top: 10px !important; color: #66815a; font-size: 11px; line-height: 1.4 !important; }
.lw-placement-status[data-tone='error'] { color: #a05a3c; }
.lw-placement-actions { display: grid; grid-template-columns: 1fr 1.8fr; gap: 9px; margin-top: 8px; }

/* Resident portraits are original small CSS illustrations. */
.lw-animal-portrait { --fur: #b48e5c; position: relative; display: block; flex-shrink: 0; width: 52px; height: 52px; overflow: hidden; border-radius: 15px; background: #ece7d1; }
.lw-animal-portrait i { position: absolute; display: block; }
.lw-face { left: 11px; top: 17px; width: 32px; height: 29px; border-radius: 40% 42% 38% 40%; background: var(--fur); transform: rotate(-6deg); box-shadow: inset -5px -2px #00000009; }
.lw-ear { top: 12px; width: 10px; height: 12px; border: 3px solid var(--fur); border-radius: 50%; background: #6f553e; }
.lw-ear.left { left: 13px; transform: rotate(-20deg); }
.lw-ear.right { right: 9px; transform: rotate(20deg); }
.lw-eye { top: 29px; width: 3px; height: 3px; border-radius: 50%; background: #413b2a; }
.lw-eye.left { left: 20px; }
.lw-eye.right { left: 34px; }
.lw-nose { left: 25px; top: 35px; width: 6px; height: 4px; border-radius: 45%; background: #614b32; }
.lw-animal-portrait.is-panda { --fur: #b97042; background: #e9ead6; }
.is-panda .lw-face { border-radius: 45%; background: linear-gradient(155deg, transparent 42%, #f1e7d1 43% 69%, transparent 70%), var(--fur); }
.is-panda .lw-ear { width: 13px; height: 15px; border: 3px solid #c0885b; border-radius: 50% 50% 30% 30%; background: #f4e7d1; }
.is-panda .lw-ear.left { left: 8px; }
.is-panda .lw-ear.right { right: 6px; }
.is-panda .lw-eye { box-shadow: 0 1px 0 3px #544739; }
.is-panda .lw-nose { background: #3e3d2d; }
.lw-animal-row { display: flex; align-items: center; gap: 12px; width: 100%; min-height: 78px; padding: 10px 0; border: 0; border-bottom: 1px solid #e6e6d7; background: none; color: #4a6044; text-align: left; }
.lw-animal-row:last-child { border-bottom: 0; }
.lw-animal-row:hover .lw-animal-copy strong { text-decoration: underline; text-underline-offset: 3px; }
.lw-animal-copy { display: flex; flex: 1; flex-direction: column; gap: 5px; min-width: 0; }
.lw-animal-copy strong { font-family: Georgia, 'Times New Roman', serif; font-size: 19px; font-weight: 500; overflow-wrap: anywhere; }
.lw-animal-copy > span { font-size: 10px; line-height: 1.4; }
.lw-animal-welfare { color: #789a60; font-size: 12px; font-weight: 650; }
.lw-animal-welfare[data-level='fair'] { color: #a88545; }
.lw-animal-welfare[data-level='low'] { color: #b56b4b; }
.lw-row-arrow { color: #adb49b; font-size: 22px; }
.lw-habitat-row { display: flex; align-items: center; gap: 11px; width: 100%; min-height: 69px; padding: 12px; border: 1px solid #e2e4d2; border-radius: 13px; background: #f7f7e9; color: #4e6447; text-align: left; }
.lw-habitat-row + .lw-habitat-row { margin-top: 8px; }
.lw-habitat-row:hover { background: #eef2df; }
.lw-habitat-row strong { display: block; font-size: 12px; overflow-wrap: anywhere; }
.lw-habitat-row small { display: block; margin-top: 4px; font-size: 10px; }
.lw-habitat-icon { color: #8b9c73; font-size: 25px; }
.lw-pill { padding: 5px 7px; border-radius: 6px; background: #e8edd7; color: #829266; font-size: 9px; text-align: center; }
.lw-care-summary { display: flex; align-items: center; gap: 16px; margin: 0 0 19px; }
.lw-big-score { color: var(--lw-moss); font-family: Georgia, 'Times New Roman', serif; font-size: 36px; font-weight: 500; letter-spacing: -.055em; }
.lw-care-summary .lw-eyebrow { color: #8c947e; font-size: 9px; }
.lw-meter { height: 7px; margin-top: 9px; overflow: hidden; border-radius: 7px; background: #e8eadb; }
.lw-meter-fill { display: block; height: 100%; border-radius: inherit; background: #91ad73; transition: width .35s ease; }
.lw-meter[data-level='fair'] .lw-meter-fill { background: #c4a466; }
.lw-meter[data-level='low'] .lw-meter-fill { background: #c4825e; }
.lw-needs { overflow: hidden; border: 1px solid #e1e5d3; border-radius: 13px; background: #fbfaee; }
.lw-need { display: flex; align-items: center; gap: 10px; padding: 11px 12px; border-bottom: 1px solid #e8e9dc; }
.lw-need:last-child { border-bottom: 0; }
.lw-need-mark { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; flex-shrink: 0; border-radius: 50%; background: #e6edd8; color: #78955c; font-size: 12px; font-weight: 700; }
.lw-need strong { display: block; color: #5f7252; font-size: 11px; }
.lw-need small { display: block; margin-top: 3px; color: #8a907c; font-size: 10px; line-height: 1.45; }
.lw-need-status { color: #819665; font-size: 9px; white-space: nowrap; }
.lw-need[data-ok='false'] .lw-need-mark { background: #f3e7d3; color: #b08648; }
.lw-need[data-ok='false'] .lw-need-status { color: #ae8250; }
.lw-adoption-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
.lw-adopt-card { display: flex; align-items: center; gap: 10px; min-height: 74px; padding: 11px; border: 1px solid #dde2ce; border-radius: 13px; background: #f6f6e9; color: #576d4c; text-align: left; }
.lw-adopt-card:hover { background: #eaf0dc; }
.lw-adopt-card .lw-animal-portrait { width: 44px; height: 48px; }
.lw-adopt-copy strong { display: block; font-size: 11px; }
.lw-adopt-copy small { display: block; margin-top: 6px; color: #a08456; font-size: 10px; }
.lw-animal-hero { display: flex; align-items: center; gap: 17px; margin-bottom: 21px; }
.lw-animal-hero .lw-animal-portrait { width: 80px; height: 80px; transform: none; }
.lw-animal-hero .lw-face { transform: translate(13px, 15px) scale(1.35) rotate(-6deg); }
.lw-animal-hero .lw-ear { transform: translate(14px, 11px) scale(1.25); }
.lw-animal-hero .lw-ear.right { right: 10px; transform: translate(-4px, 11px) scale(1.25); }
.lw-animal-hero .lw-eye { transform: translate(14px, 16px); }
.lw-animal-hero .lw-eye.right { transform: translate(17px, 16px); }
.lw-animal-hero .lw-nose { transform: translate(16px, 18px) scale(1.2); }
.lw-animal-activity { margin-top: 5px !important; color: #687b5c; font-family: Georgia, 'Times New Roman', serif; font-size: 21px; }

/* The business is legible without turning the zoo into a dashboard. */
.lw-budget { padding: 7px 14px; border: 1px solid #e2e6d3; border-radius: 13px; background: #f3f5e7; }
.lw-budget-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 10px 0; color: #7a866d; font-size: 12px; }
.lw-budget-row strong { color: #546e46; font-variant-numeric: tabular-nums; }
.lw-budget-row.is-total { margin-top: 2px; border-top: 1px solid #dce2cb; color: #4b6641; font-weight: 650; }
.lw-budget-row strong[data-negative='true'] { color: #b16845; }
.lw-field-label { display: block; margin-bottom: 8px; color: #687b58; font-size: 11px; font-weight: 600; }
.lw-input { width: 100%; min-width: 0; min-height: 44px; padding: 10px 12px; border: 1px solid #d6dfc6; border-radius: 10px; background: #fffef7; color: #40583b; font-size: 16px; }
.lw-inline-form { display: flex; gap: 9px; }
.lw-inline-form > .lw-input { flex: 1; }
.lw-inline-form > .lw-button { flex-shrink: 0; }
.lw-price-input { position: relative; flex: 1; }
.lw-price-input > span { position: absolute; top: 13px; left: 13px; color: #8b977b; font-size: 14px; }
.lw-price-input .lw-input { padding-left: 28px; }
.lw-name-form { margin: 23px 0; }
.lw-keeper-count { color: #5c7250; font-size: 13px; }
.lw-keeper-count + .lw-small-note { margin-top: 4px !important; margin-bottom: 12px; }
.lw-ledger-row { display: flex; justify-content: space-between; gap: 15px; padding: 8px 0; border-bottom: 1px solid #e7e7d8; color: #87907a; font-size: 10px; }
.lw-ledger-row:last-child { border-bottom: 0; }
.lw-ledger-row strong { flex-shrink: 0; color: #718a56; font-weight: 600; }
.lw-ledger-row strong.is-expense { color: #b18a68; }
.lw-save-detail { margin-bottom: 12px !important; color: #78876a; font-size: 11px; overflow-wrap: anywhere; }
.lw-goal-list { display: flex; flex-direction: column; gap: 10px; margin: 0 0 22px; padding: 0; list-style: none; }
.lw-goal-list li { display: flex; align-items: center; gap: 13px; padding: 14px; border: 1px solid #e1e5d1; border-radius: 12px; background: #f8f8eb; color: #657957; font-size: 12px; line-height: 1.4; }
.lw-goal-mark { display: flex; align-items: center; justify-content: center; flex-shrink: 0; width: 29px; height: 29px; border-radius: 50%; background: #ebeeda; color: #9b9d79; font-family: Georgia, 'Times New Roman', serif; font-size: 16px; }
.lw-goal-list li[data-done='true'] { background: #edf3e1; }
.lw-goal-list li[data-done='true'] .lw-goal-mark { background: #d9e7c7; color: #729752; }
.lw-guide-steps { counter-reset: guide; margin: 0 0 20px; padding: 0; list-style: none; }
.lw-guide-steps li { position: relative; padding: 0 0 20px 35px; counter-increment: guide; }
.lw-guide-steps li::before { content: counter(guide); position: absolute; left: 0; top: 0; display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; border-radius: 50%; background: #e9edd9; color: #7c915f; font-family: Georgia, 'Times New Roman', serif; font-size: 14px; }
.lw-guide-steps strong { color: #526e46; font-size: 12px; }
.lw-guide-steps p { margin-top: 5px; color: #737e65; font-size: 12px; }
.lw-guide > .lw-button { margin-bottom: 24px; }
.lw-guide .lw-panel-section > p { margin-bottom: 9px; color: #737e65; font-size: 12px; }

/* Destructive actions get a real, accessible in-game confirmation. */
.lw-dialog, .import-dialog { width: min(425px, calc(100% - 32px)); max-height: calc(100dvh - 40px); padding: 29px; overflow-y: auto; border: 1px solid #fff9e9; border-radius: 24px; background: #fffaf0; color: #576e4b; box-shadow: 0 20px 80px #2038254d; pointer-events: auto; }
.lw-dialog::backdrop, .import-dialog::backdrop { background: #26392969; backdrop-filter: blur(4px); }
.lw-dialog-flower { display: block; margin-bottom: 20px; color: #b7704f; font-size: 45px; }
.lw-dialog h2 { margin: 5px 0 12px; color: var(--lw-deep); font-size: 32px; line-height: 1.08; }
.lw-dialog p, .import-dialog p { color: #808871; font-size: 13px; line-height: 1.55; }
.lw-dialog .lw-text-button { margin: 0 0 10px; color: #a17550; }
.lw-dialog-actions { display: flex; gap: 9px; margin-top: 13px; }
.lw-dialog-actions > .lw-button { flex: 1; }
.import-dialog h2 { font-family: Georgia, 'Times New Roman', serif; font-size: 27px; font-weight: 500; letter-spacing: -.04em; }
.import-dialog button { min-height: 44px; margin: 5px 8px 5px 0; padding: 10px 15px; border: 1px solid #cfdbbd; border-radius: 11px; background: #e6efd8; color: #456039; font-size: 12px; font-weight: 650; }
.import-dialog button[type='submit'] { background: var(--lw-moss); border-color: var(--lw-moss); color: #fffaf0; }

@media (min-width: 1000px) {
  .lw-sheet { left: auto; right: 23px; bottom: 22px; width: 385px; max-height: calc(100dvh - 44px); transform: none; }
  .lw-dock { width: 370px; }
  .lw-build-grid { gap: 8px; }
  .lw-build-card { gap: 8px; padding: 11px 10px; }
  .lw-build-symbol { width: 28px; height: 31px; }
  .lw-adopt-card { gap: 8px; padding: 10px 8px; }
  .lw-adopt-card .lw-animal-portrait { width: 39px; }
  .lw-world-controls { bottom: 25px; }
}

@media (max-width: 600px) {
  .lw-top-stack { top: max(10px, env(safe-area-inset-top)); left: 12px; width: calc(100% - 24px); gap: 8px; }
  .lw-hud { padding: 11px 12px 7px; border-radius: 19px; }
  .lw-hud-top { gap: 5px; }
  .lw-wordmark { gap: 6px; }
  .lw-wordmark strong { font-size: 25px; }
  .lw-wordmark small { font-size: 8px; }
  .lw-brand-flower { font-size: 29px; }
  .lw-time-controls { gap: 4px; }
  .lw-day { margin-right: 1px; font-size: 9px; }
  .lw-round-button { width: 40px; min-width: 40px; height: 44px; border-radius: 12px; }
  .lw-help-button { width: 40px; min-width: 40px; }
  .lw-hud-metrics { margin-top: 9px; padding-top: 8px; }
  .lw-metric { min-height: 40px; }
  .lw-metric-value { font-size: 22px; }
  .lw-metric-label { font-size: 9px; }
  .lw-save-status { margin-top: 4px !important; font-size: 9px; }
  .lw-goal-peek { max-width: 300px; padding: 10px 12px; gap: 9px; border-radius: 13px; }
  .lw-goal-label { font-size: 11px; }
  .lw-goal-copy small { font-size: 8px; }
  .lw-goal-progress { font-size: 9px; }
  .has-sheet .lw-goal-peek, .has-tool .lw-goal-peek { display: none; }
  .lw-sheet { width: calc(100% - 24px); max-height: min(54dvh, calc(100dvh - 275px)); border-radius: 21px; }
  .lw-sheet-header { padding: 16px 17px 13px; }
  .lw-sheet-header h2 { font-size: 25px; }
  .lw-sheet-body { padding: 15px 17px 20px; }
  .lw-collapse { width: 44px; min-width: 44px; height: 44px; border-radius: 50%; }
  .lw-build-card { min-height: 104px; padding: 12px 10px; gap: 8px; }
  .lw-build-symbol { width: 29px; height: 32px; font-size: 23px; }
  .lw-build-card strong { font-size: 11px; }
  .lw-build-card small { font-size: 9px; }
  .lw-adopt-card { gap: 7px; padding: 11px 8px; }
  .lw-adopt-card .lw-animal-portrait { width: 39px; }
  .lw-adopt-copy strong { font-size: 10px; }
  .lw-adopt-copy small { font-size: 9px; }
  .lw-placement { width: calc(100% - 24px); padding: 14px 16px; }
  .lw-placement-title { font-size: 19px; }
  .lw-dimensions { gap: 13px; }
  .lw-dimension { gap: 6px; }
  .lw-stepper { gap: 3px; }
  .lw-step-button { width: 44px; }
  .lw-world-controls { right: 14px; }
  .has-tool .lw-world-controls { bottom: calc(var(--lw-panel-bottom) + 245px); flex-direction: row; gap: 6px; }
  .lw-world-controls .lw-round-button { border-radius: 50%; }
  .lw-dock { width: calc(100% - 24px); border-radius: 20px; }
  .lw-notice { padding: 10px 12px; font-size: 11px; }
}

@media (max-width: 360px) {
  .lw-wordmark strong { font-size: 22px; }
  .lw-brand-flower { font-size: 24px; }
  .lw-wordmark small { display: none; }
  .lw-day { display: none; }
  .lw-build-grid, .lw-adoption-grid { grid-template-columns: 1fr; }
  .lw-build-card { min-height: 76px; }
  .lw-dimension { flex-direction: column; align-items: stretch; }
  .lw-stepper { gap: 10px; }
  .lw-dimension > span { text-align: center; }
  .lw-dialog { padding: 23px; }
  .lw-dialog-actions { flex-direction: column; }
}

@media (max-height: 560px) and (orientation: landscape) {
  .lw-top-stack { top: 10px; left: 12px; width: 290px; gap: 7px; }
  .lw-hud { padding: 10px 12px 6px; }
  .lw-wordmark strong { font-size: 22px; }
  .lw-wordmark small, .lw-day, .lw-help-button { display: none; }
  .lw-hud-metrics { margin-top: 7px; padding-top: 6px; }
  .lw-metric { min-height: 34px; }
  .lw-metric-value { font-size: 19px; }
  .lw-save-status { font-size: 8px; }
  .lw-goal-peek { max-width: 270px; padding: 8px 11px; }
  .has-tool .lw-goal-peek { display: none; }
  .lw-goal-label { font-size: 10px; }
  .lw-dock { left: 12px; bottom: max(10px, env(safe-area-inset-bottom)); width: 290px; transform: none; padding: 5px; }
  .lw-dock-button { min-height: 48px; gap: 2px; }
  .lw-dock-icon { font-size: 20px; line-height: 21px; }
  .lw-sheet { top: 10px; right: 12px; bottom: 10px; left: auto; width: min(350px, calc(100% - 326px)); max-height: none; transform: none; }
  .lw-sheet-header { padding: 12px 15px; }
  .lw-sheet-header h2 { font-size: 23px; }
  .lw-sheet-body { padding: 13px 15px; }
  .lw-placement { right: 12px; bottom: 10px; left: auto; width: min(350px, calc(100% - 326px)); max-height: calc(100dvh - 20px); overflow-y: auto; transform: none; padding: 13px 15px; }
  .lw-placement-title { font-size: 18px; }
  .lw-placement-hint, .lw-placement-status { font-size: 10px; }
  .lw-dimension { flex-direction: column; align-items: stretch; }
  .lw-dimension > span { text-align: center; }
  .lw-world-controls { right: 12px; top: 10px; bottom: auto; flex-direction: row; }
  .has-tool .lw-world-controls { right: auto; left: 238px; top: 151px; bottom: auto; flex-direction: column; }
  .lw-build-grid, .lw-adoption-grid { grid-template-columns: 1fr; }
  .lw-build-card { min-height: 72px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; animation: none !important; }
}

.lw-feedback textarea { display:block; width:100%; box-sizing:border-box; font:inherit; font-size:16px; padding:12px; border:1px solid #aaa; border-radius:12px; resize:vertical; min-height:100px; color:#263b32; background:#fff; }
.lw-feedback textarea:focus-visible { outline:3px solid #b36b36; outline-offset:3px; }
.lw-feedback-status { min-height:1.5em; font-size:14px; }
.lw-feedback { overflow-y:auto; }

.arcade-return{position:static;align-self:flex-start;pointer-events:auto;z-index:20;display:flex;align-items:center;min-height:44px;padding:8px 12px;border-radius:12px;background:#fff9ec;color:#31422e;text-decoration:none;box-shadow:0 2px 8px #0002}

/* Management uses the existing sheet and large controls, so the map stays usable. */
.lw-management { border-bottom: 1px solid #d7ddc9; padding-bottom: 18px; margin-bottom: 18px; }
.lw-warning { padding: 10px 12px; border-left: 3px solid #b26839; background: #fff3df; color: #67462c; border-radius: 5px; font-size: 13px; line-height: 1.45; }
.lw-forecast { display: grid; gap: 5px; padding: 12px; border: 1px solid #d7ddc9; border-radius: 12px; background: #f3f5e9; margin-bottom: 8px; font-size: 13px; }
.lw-forecast strong { color: #35523b; }
.lw-capacity-list p { margin: 8px 0; font-size: 13px; }
.lw-scenario-card { border: 1px solid #d3dac5; border-radius: 16px; padding: 18px; background: #faf9ee; margin: 14px 0; }
.lw-scenario-card h3 { margin: 7px 0; font-family: Georgia, serif; font-size: 23px; }
.lw-scenario-card p { font-size: 14px; line-height: 1.5; }
.lw-management .lw-button-row { gap: 8px; align-items: center; flex-wrap: wrap; }
.lw-management button[aria-pressed=true] { background: #3e654a; color: #fff; }
.lw-management button { min-height: 44px; }
.lw-scenario-card button { min-height: 44px; }
.lw-management .is-expense { color: #9b4d30; }
.lw-goal-label { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
@media(max-width: 600px) { .lw-goal-peek { max-height: 113px; } .lw-scenario-card { padding: 14px; } }
