/* Shared resets, typography, icons, forms and administration. */
@layer base {
    *, *::before, *::after { box-sizing: border-box; }
    html, body { margin: 0; width: 100%; height: 100%; }
    button, input, select { font: inherit; }
    button, a, input { -webkit-tap-highlight-color: transparent; }
    button { cursor: pointer; }
    button { color: inherit; }
    button:disabled { opacity: .45; cursor: not-allowed; }
    button, a, input { outline-offset: 4px; }
    :focus-visible { outline: 2px solid #608b73; }
    a { color: inherit; text-decoration: none; }
    h1, h2, h3, h4, p { margin: 0; }
    [x-cloak], [hidden] { display: none !important; }
}

:root { --ink: var(--ui-ink); --muted: var(--ui-muted); --green: var(--ui-accent); --deep-green: var(--ui-primary-hover); --line: var(--ui-border); --paper: var(--ui-surface); --cream: var(--ui-background); --soft-green: var(--ui-selected); --amber: var(--ui-warning); --red: var(--ui-error); --shadow: 0 5px 22px #43553b0b, 0 1px 3px #43553b04; }

body { font-family: 'DM Sans', system-ui, sans-serif; font-size: 13px; color: var(--ink); background: var(--cream); overflow: hidden; -webkit-font-smoothing: antialiased; }

button { border: 0; background: none; padding: 0; }

.icon-library { position: absolute; width: 0; height: 0; overflow: hidden; pointer-events: none; }

:is(.login-card, .forgot-card, .register-card) { max-width: 468px; }

@media (max-width: 920px) {
    :is(.login-card, .forgot-card, .register-card) { max-width: 500px; }
}

.auth-card-head { display: flex; align-items: flex-start; gap: 20px; }
.auth-card-seal { display: block; flex: none; width: 58px; height: 58px; margin-top: 3px; }
.auth-card-heading { min-width: 0; overflow-wrap: anywhere; }

@media (max-width: 520px) {
    .auth-card-head { gap: 15px; }
    .auth-card-seal { width: 50px; height: 50px; }
}

.icon { width: 21px; height: 21px; flex: none; display: inline-block; vertical-align: middle; }

.icon.small { width: 17px; height: 17px; }

.icon.tiny { width: 14px; height: 14px; }

.down { transform: rotate(90deg); }

.icon-button { width: 34px; height: 34px; display: inline-flex; align-items: center; justify-content: center; flex: none; border-radius: 8px; color: #7e8b7b; transition: background .15s, color .15s; }

.icon-button:hover { color: var(--green); background: #e9eee3; }

.tiny-button { width: 25px; height: 25px; }

.positive { color: #5e8865 !important; }

.negative { color: var(--red) !important; }

.eyebrow { display: block; font-size: 9px; font-weight: 650; letter-spacing: 1.5px; line-height: 1.5; color: #90987f; }

.status-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: #89a779; flex: none; }

.status-dot.warning { background: #cc9a58; }

.brand { display: flex; align-items: center; gap: 11px; min-width: 224px; }

.brand > span { display: flex; flex-direction: column; gap: 1px; }

.brand strong { font: 800 23px/1.1 'Manrope', sans-serif; letter-spacing: 2px; }

.brand-dot { color: #a9b888; }

.brand small { font-size: 8px; letter-spacing: 2.2px; color: #8d967f; font-weight: 600; }

.header-nav .icon { width: 17px; height: 17px; }

.profile-button > .icon { margin-left: 5px; width: 12px; color: #9aa28e; transform: rotate(90deg); }

.resource-intro .eyebrow { font-size: 8px; letter-spacing: 1.45px; margin-bottom: 7px; }

.resource-supply .status-dot { margin: 19px 0 0 0; width: 5px; height: 5px; }

.rail-button > .icon { width: 21px; height: 21px; }

.city-label .eyebrow { font-size: 7px; letter-spacing: 1.5px; margin-bottom: 3px; }

.scene-location .status-dot { width: 4px; height: 4px; }

.view-selector > .icon:first-child { width: 16px; height: 16px; }

.view-selector .down { width: 10px; height: 10px; margin-left: auto; }

.view-controls > .icon-button { width: 27px; height: 27px; }

.view-controls > .icon-button > .icon { width: 16px; height: 16px; }

.icon-button.is-selected { background: #e5edde; color: #628454; }

.advisor-avatar .icon { width: 14px; height: 14px; }

.card-heading { display: flex; align-items: center; justify-content: space-between; gap: 10px; }

.card-heading h2 { font-size: 11px; font-weight: 600; }

.card-heading h3 { font-size: 14px; font-weight: 600; }

.card-heading .icon-button { color: #a5ae96; }
.dock-heading > div:first-child > .icon { color: #8a9b76; width: 15px; height: 15px; }
.tool-illustration .icon { width: 29px; height: 29px; stroke-width: 1.3; filter: drop-shadow(2px 3px 0 #94a97a0d); }
.tool-selected-check .icon { width: 9px; height: 9px; }
.dock-footer .status-dot { width: 4px; height: 4px; }

kbd { font-family: inherit; border: 1px solid #dde3d0; font-size: 7px; font-weight: 500; padding: 2px 4px; border-radius: 3px; line-height: 1; }
.minimap-header .icon { width: 11px; height: 11px; }
.minimap-footer .status-dot { width: 3px; height: 3px; }
.north-indicator .icon { width: 28px; height: 28px; stroke-width: 1; transform: rotate(-24deg); }
.camera-controls .icon-button { width: 29px; height: 29px; }
.camera-controls .icon-button .icon { width: 16px; height: 16px; }
.inspect-icon .icon { width: 28px; height: 28px; }
.inspector .danger-button { width: 100%; font-size: 10px; margin-top: 5px; }
.save-status .icon { width: 13px; height: 13px; }
.time-controls button .icon { width: 10px; height: 10px; }
.loading-orbit .icon { width: 30px; height: 30px; }
.toast .icon-button { margin-left: 4px; }
.modal-header .eyebrow { font-size: 8px; letter-spacing: 1.7px; margin-bottom: 9px; }
.modal-close .icon { width: 16px; height: 16px; }

.primary-button, .secondary-button { display: inline-flex; align-items: center; justify-content: center; padding: 12px 16px; border-radius: 7px; gap: 8px; background: #477159; border: 1px solid #477159; color: #fff; font-size: 11px; font-weight: 550; transition: background .15s, border-color .15s; min-height: 39px; }
.primary-button:hover { background: #345d46; border-color: #345d46; }
.secondary-button { background: #f2f5ea; color: #7c9369; border-color: #dce5d1; }
.secondary-button:hover { background: #e5edda; border-color: #c4d4b3; }
.danger-button { color: #b08c68; background: #f6f0e5; border-color: #e9dcc9; }
.danger-button:hover { background: #eee1d0; border-color: #d8c4aa; }

input:not([type=range]):not([type=checkbox]), select { border: 1px solid #dfe5d7; background: #fffefa; border-radius: 6px; color: #526b49; padding: 11px 12px; width: 100%; font-size: 11px; min-width: 0; }
.field-label { display: block; font-size: 10px; font-weight: 550; color: #7a8d6a; margin: 18px 0 8px; }
input::placeholder { color: #b3bca5; }
input:focus { border-color: #98b283; }
.world-mode .status-dot { width: 5px; height: 5px; }
.region-biome .icon { width: 13px; height: 13px; }
.region-facts .icon { width: 15px; height: 15px; }
.region-demo-note .icon { width: 13px; height: 13px; margin-top: 2px; }

.finance-summary { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; margin-bottom: 28px; }
.finance-summary > div { padding: 13px 15px; background: #f0f4e8; border: 1px solid #e7eddd; border-radius: 9px; }
.finance-summary span { color: #94a283; font-size: 9px; display: block; margin-bottom: 8px; }
.finance-summary strong { font: 700 21px 'Manrope', sans-serif; letter-spacing: -.6px; }
.panel-section { background: #fefef9; border: 1px solid #e7ecdf; padding: 21px 23px; border-radius: 10px; }
.section-heading { display: flex; gap: 9px; align-items: center; }
.section-heading h3 { font-size: 13px; font-weight: 600; }
.section-heading .icon { width: 17px; height: 17px; color: #94a67c; }
.panel-section > p { font-size: 10px; color: #a1ae92; margin: 9px 0 22px; line-height: 1.8; }
.slider-field.compact > span .icon { width: 14px; height: 14px; color: #9eae8b; }
.panel-section > button { margin-top: 25px; }
.ledger-section .card-heading > span { color: #a7b396; font-size: 8px; }
.table-scroll { overflow-x: auto; margin-top: 15px; }
table { border-collapse: collapse; width: 100%; font-size: 10px; text-align: left; }
th { color: #a4b195; font-weight: 500; background: #f0f4e8; }
td, th { padding: 11px 13px; border-bottom: 1px solid #e9eddf; }
td { color: #859674; }
td:last-child, th:last-child { text-align: right; }
td:first-child { font-size: 8px; white-space: nowrap; color: #a0ad91; }
.stat-tile-icon .icon { width: 20px; height: 20px; }
.account-modal form > .primary-button { margin-top: 25px; }
.form-error { color: #b87e60; font-size: 10px; line-height: 1.7; margin-top: 15px; }
.settings-modal .field-label { margin-top: 0; }
.input-button-row { display: flex; gap: 8px; }
.input-button-row button { flex: none; }
.setup-page { max-width: 650px; margin: 12vh auto; padding: 30px; line-height: 1.9; }
.setup-page > img { margin-bottom: 20px; }
.setup-page h1 { font: 750 36px 'Manrope', sans-serif; margin-bottom: 25px; }
.setup-page p { color: #8b9d7c; margin-bottom: 30px; }
.setup-page code { background: #eaf0df; font-size: 12px; padding: 2px 4px; border-radius: 3px; }

.static-page { overflow: auto; }
.admin-shell { max-width: 1000px; margin: 50px auto; padding: 25px; }
.admin-header { display: flex; align-items: center; justify-content: space-between; gap: 25px; margin-bottom: 28px; }
.admin-header h1 { font: 750 27px 'Manrope', sans-serif; }
.admin-header > a { font-size: 12px; color: #80996b; }
.admin-shell .finance-summary { grid-template-columns: repeat(3, 1fr); }
.admin-shell .panel-section { margin-bottom: 20px; }
.admin-shell td, .admin-shell th { font-size: 11px; }
.admin-note { font-size: 11px; line-height: 1.9; color: #91a27e; }
.admin-note code { background: #edf2e2; padding: 3px 5px; border-radius: 4px; font-size: 10px; }

@media (min-width: 1550px) {.tool-illustration .icon { width: 33px; height: 33px; }
.card-heading h2 { font-size: 13px; }
}

@media (max-width: 1250px) {.brand { min-width: 200px; }
}

@media (max-width: 1050px) {.brand { min-width: 175px; }
.brand strong { font-size: 20px; }
}

@media (max-width: 820px) {.brand { min-width: 0; gap: 8px; }
.brand img { width: 31px; height: 31px; }
.brand strong { font-size: 17px; letter-spacing: 1.3px; }
.brand small { font-size: 6px; letter-spacing: 1.5px; }
.profile-button > .icon { display: none; }
.resource-supply .status-dot { display: none; }
.rail-button > .icon { width: 19px; height: 19px; }
.city-label .eyebrow { font-size: 6px; }
.city-label-icon .icon { width: 17px; height: 17px; }
.tool-illustration .icon { width: 23px; height: 23px; }
.finance-summary { gap: 9px; }
.finance-summary > div { padding: 12px; }
.finance-summary strong { font-size: 18px; }
.panel-section { padding: 17px; }
}

@media (max-width: 600px) {.brand strong { font-size: 17px; }
.rail-button > .icon { width: 18px; height: 18px; }
.city-label .eyebrow { font-size: 5px; }
.view-selector > .icon:last-child { display: none; }
.view-controls > .icon-button { width: 24px; height: 24px; }
.view-controls > .icon-button .icon { width: 14px; height: 14px; }
.demand-card .card-heading h2 { font-size: 8px; }
.demand-card .icon-button { width: 16px; height: 16px; }
.demand-card .icon { width: 11px; height: 11px; }
.dock-heading > div:first-child > .icon { width: 12px; height: 12px; }
.tool-illustration .icon { width: 21px; height: 21px; }
.tool-selected-check .icon { width: 7px; height: 7px; }
.camera-controls .icon-button { width: 24px; height: 26px; }
.camera-controls .icon-button > .icon { width: 13px; height: 13px; }
.save-status > .icon { display: none; }
.inspect-icon > .icon { width: 20px; height: 20px; }
.need-list .icon { width: 9px; height: 9px; }
.inspector .danger-button { font-size: 8px; padding: 8px 6px; min-height: 30px; }
.inspector .eyebrow { font-size: 6px; letter-spacing: .8px; }
.modal-header .eyebrow { font-size: 7px; letter-spacing: 1.2px; }
.pin-dot .icon { width: 9px; height: 9px; }
.finance-summary { grid-template-columns: 1fr 1fr; gap: 9px; margin-bottom: 20px; }
.finance-summary strong { font-size: 21px; }
.finance-summary > div { padding: 12px 14px; }
.panel-section { padding: 19px; }
.finance-summary span { font-size: 8px; }
.stat-tile .icon { width: 15px; height: 15px; }
.admin-shell { margin: 10px auto; padding: 18px; }
.admin-header { align-items: start; flex-direction: column; gap: 15px; }
.admin-shell .finance-summary { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}


/* Keep supporting controls readable at standard desktop resolutions. */
@media (min-width: 1051px) {
    .city-label .eyebrow { font-size: 8px; }

    .card-heading h2 { font-size: 12px; }
}
