:root {
    color-scheme: dark;
    --bg: #101113;
    --bg-soft: #151619;
    --panel: #181a1d;
    --panel-strong: #202327;
    --line: #33373d;
    --line-soft: rgba(255, 255, 255, 0.08);
    --text: #f2f0e8;
    --muted: #b9b4aa;
    --dim: #868176;
    --green: #8ebf9f;
    --green-deep: #5f8f73;
    --cyan: #8fb6c8;
    --amber: #d7b56d;
    --orange: #c98a55;
    --red: #d97979;
    --purple: #b6a0cf;
    --shadow: 0 20px 52px rgba(0, 0, 0, 0.42);
}

* {
    box-sizing: border-box;
}

html,
body {
    margin: 0;
    min-height: 100%;
}

body.food-sim {
    min-height: 100vh;
    font-family: "Outfit", Arial, sans-serif;
    font-size: 15px;
    background: linear-gradient(180deg, #131416 0%, #0f1012 100%);
    color: var(--text);
}

body.guide-modal-open {
    overflow: hidden;
}

button,
input,
select {
    font: inherit;
}

button {
    cursor: pointer;
}

.sim-topbar {
    position: sticky;
    top: 0;
    z-index: 20;
    min-height: 74px;
    padding: 12px 18px;
    display: grid;
    grid-template-columns: auto auto 230px 240px minmax(480px, 1fr);
    gap: 10px;
    align-items: center;
    background: rgba(16, 17, 19, 0.94);
    border-bottom: 1px solid var(--line-soft);
    backdrop-filter: blur(18px);
}

.page-nav {
    display: flex;
    align-items: center;
    gap: 8px;
}

.nav-button {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 14px;
    color: var(--text);
    background: #1b1d20;
    text-decoration: none;
    font-weight: 700;
}

.nav-button:hover {
    border-color: rgba(142, 191, 159, 0.62);
    background: #22262a;
}

.brand {
    color: var(--text);
    font-size: 1.3rem;
    font-weight: 700;
    text-decoration: none;
    letter-spacing: 0;
}

.tool-title {
    min-width: 0;
}

.tool-kicker,
.panel-kicker {
    display: block;
    color: var(--green);
    font-size: 0.74rem;
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

h1,
h2,
h3,
p {
    margin: 0;
}

h1 {
    margin-top: 2px;
    font-size: 1.26rem;
    font-weight: 700;
    letter-spacing: 0;
}

h2 {
    margin-top: 2px;
    font-size: 1.08rem;
    font-weight: 700;
    letter-spacing: 0;
}

h3 {
    font-size: 0.95rem;
    font-weight: 700;
}

.sim-controls {
    min-width: 0;
    display: flex;
    align-items: center;
    justify-content: flex-end;
    gap: 9px;
    flex-wrap: wrap;
}

.control-button,
.text-button,
.item-action {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    color: var(--text);
    background: #1b1d20;
    transition: border-color 120ms ease, background 120ms ease, transform 120ms ease;
}

.control-button {
    padding: 0 14px;
    font-weight: 700;
}

.control-button:hover,
.text-button:hover,
.item-action:hover {
    border-color: rgba(142, 191, 159, 0.7);
    background: #22262a;
}

.control-button:active,
.item-action:active {
    transform: translateY(1px);
}

.control-button.primary {
    color: #101113;
    border-color: #a4c8ad;
    background: var(--green);
}

.control-button.guide-launch {
    min-width: 0;
    width: 240px;
    justify-self: start;
    border-color: rgba(242, 240, 232, 0.32);
    color: #101113;
    background:
        linear-gradient(135deg, #d7b56d 0%, #a9c29a 46%, #8fb6c8 100%);
    box-shadow: 0 0 0 1px rgba(215, 181, 109, 0.18), 0 12px 30px rgba(143, 182, 200, 0.14);
    text-transform: uppercase;
    letter-spacing: 0.04em;
}

.control-button.guide-launch:hover {
    border-color: rgba(242, 240, 232, 0.58);
    background:
        linear-gradient(135deg, #e0c17d 0%, #b5cda7 46%, #9fc4d3 100%);
    box-shadow: 0 0 0 1px rgba(215, 181, 109, 0.24), 0 16px 36px rgba(143, 182, 200, 0.2);
}

.select-wrap,
.toggle-wrap {
    min-height: 38px;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    border: 1px solid var(--line);
    border-radius: 7px;
    background: rgba(27, 29, 32, 0.92);
    padding: 0 10px;
}

.select-wrap span,
.toggle-wrap span {
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 700;
}

.select-wrap select {
    min-width: 74px;
    border: 0;
    color: var(--text);
    background: #181a1d;
    outline: none;
}

.select-wrap select option {
    color: var(--text);
    background: #141619;
}

.toggle-wrap input {
    accent-color: var(--green);
}

.sim-shell {
    height: calc(100vh - 74px);
    padding: 18px;
    display: grid;
    grid-template-columns: minmax(640px, 1fr) minmax(380px, 520px);
    gap: 18px;
}

.item-browser,
.stomach-stage,
.analysis-panel {
    min-height: 0;
    overflow: hidden;
    border: 1px solid var(--line-soft);
    background: rgba(24, 26, 29, 0.95);
    box-shadow: var(--shadow);
}

.item-browser,
.analysis-panel {
    border-radius: 8px;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.panel-head,
.stomach-header,
.queue-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
}

.item-count,
.digest-rate {
    min-width: 48px;
    height: 32px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: #101113;
    background: var(--green);
    font-weight: 800;
}

.item-search {
    flex: 0 0 auto;
    width: 100%;
    min-height: 42px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 13px;
    color: var(--text);
    background: #111315;
    outline: none;
}

.item-search:focus {
    border-color: var(--green);
}

.category-tabs {
    flex: 0 0 auto;
    min-height: 34px;
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    overflow: visible;
}

.category-tab {
    flex: 0 0 auto;
    min-height: 30px;
    border: 1px solid var(--line);
    border-radius: 999px;
    padding: 0 10px;
    color: var(--muted);
    background: #17191d;
    font-size: 0.84rem;
    font-weight: 700;
}

.category-tab.active {
    color: #101113;
    border-color: var(--green);
    background: var(--green);
}

.item-list {
    flex: 1 1 auto;
    min-height: 0;
    overflow: auto;
    display: block;
    padding-right: 0;
    scrollbar-width: thin;
}

.item-table {
    width: 100%;
    min-width: 760px;
    border-collapse: separate;
    border-spacing: 0 6px;
}

.item-table th {
    position: sticky;
    top: 0;
    z-index: 2;
    padding: 0 9px 8px;
    color: var(--dim);
    background: #151619;
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0.06em;
    text-align: left;
    text-transform: uppercase;
}

.item-table th.numeric,
.item-table td.numeric {
    text-align: right;
}

.item-row {
    --item-color: var(--green);
}

.item-row.draggable {
    cursor: grab;
}

.item-row.draggable:active {
    cursor: grabbing;
}

.item-row td {
    padding: 8px 9px;
    border-top: 1px solid var(--line-soft);
    border-bottom: 1px solid var(--line-soft);
    background: #141619;
    vertical-align: middle;
}

.item-row td:first-child {
    border-left: 3px solid var(--item-color);
    border-radius: 8px 0 0 8px;
}

.item-row td:last-child {
    border-right: 1px solid var(--line-soft);
    border-radius: 0 8px 8px 0;
}

.item-identity {
    display: flex;
    align-items: center;
    gap: 10px;
    min-width: 0;
}

.item-preview-box {
    position: relative;
    width: 62px;
    height: 58px;
    flex: 0 0 62px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 1px solid rgba(185, 180, 170, 0.18);
    border-radius: 7px;
    background:
        radial-gradient(circle at 50% 42%, rgba(142, 191, 159, 0.13), transparent 60%),
        #0f1113;
}

.item-preview-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    user-select: none;
    -webkit-user-drag: none;
}

.item-preview-fallback {
    display: none;
    padding: 0 5px;
    color: var(--dim);
    font-size: 0.62rem;
    font-weight: 800;
    line-height: 1.05;
    text-align: center;
    text-transform: uppercase;
}

.item-preview-box.is-missing .item-preview-fallback {
    display: block;
}

.item-row .item-name strong,
.item-row .item-name span {
    max-width: 220px;
}

.item-table .stage-select {
    width: 132px;
    min-height: 30px;
    font-size: 0.84rem;
}

.table-actions {
    display: flex;
    justify-content: flex-end;
    gap: 6px;
}

.table-actions .item-action {
    min-height: 30px;
    padding: 0 9px;
    font-size: 0.84rem;
}

.item-card {
    border: 1px solid var(--line-soft);
    border-left: 3px solid var(--green);
    border-radius: 8px;
    padding: 11px;
    background: #141619;
}

.item-card.draggable {
    cursor: grab;
}

.item-card:active {
    cursor: grabbing;
}

.item-main {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 10px;
}

.item-name {
    min-width: 0;
}

.item-name strong {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    font-size: 0.96rem;
}

.item-name span {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: var(--dim);
    font-size: 0.78rem;
}

.item-qty {
    flex: 0 0 auto;
    color: var(--amber);
    font-weight: 800;
}

.item-meta {
    margin-top: 10px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 7px;
}

.mini-stat {
    min-width: 0;
    border: 1px solid var(--line-soft);
    border-radius: 6px;
    padding: 6px 7px;
    background: rgba(255, 255, 255, 0.03);
}

.mini-stat span {
    display: block;
    color: var(--dim);
    font-size: 0.7rem;
    font-weight: 700;
}

.mini-stat strong {
    display: block;
    margin-top: 2px;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--text);
    font-size: 0.84rem;
}

.item-actions {
    margin-top: 10px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto auto;
    gap: 8px;
}

.item-actions.hand-liquid {
    grid-template-columns: minmax(0, 1fr) minmax(122px, auto);
}

.stage-select {
    min-width: 0;
    min-height: 34px;
    border: 1px solid var(--line);
    border-radius: 6px;
    color: var(--text);
    background: #111315;
}

.item-action {
    min-height: 34px;
    padding: 0 10px;
    font-weight: 800;
}

.drink-action {
    border-color: rgba(143, 182, 200, 0.62);
    color: #101113;
    background: linear-gradient(135deg, var(--cyan), var(--green));
}

.drink-action:hover {
    border-color: rgba(142, 191, 159, 0.9);
    background: linear-gradient(135deg, #9fc7d5, #a7ccb1);
}

.stomach-stage {
    border-radius: 8px;
    padding: 16px;
    display: grid;
    grid-template-rows: auto minmax(230px, 1fr) auto auto minmax(118px, 0.35fr);
    gap: 12px;
}

.stomach-meter {
    position: relative;
    width: min(260px, 42%);
    min-width: 160px;
    height: 36px;
    overflow: hidden;
    border: 1px solid var(--line);
    border-radius: 999px;
    background: #111315;
}

.stomach-meter-fill {
    width: 0%;
    height: 100%;
    background: linear-gradient(90deg, var(--green), var(--amber), var(--red));
    transition: width 160ms ease;
}

.stomach-meter span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text);
    font-weight: 800;
    text-shadow: 0 1px 2px #000;
}

.bucket-zone {
    position: relative;
    min-height: 250px;
    border: 1px dashed rgba(142, 191, 159, 0.42);
    border-radius: 8px;
    outline: none;
    background:
        linear-gradient(135deg, rgba(142, 191, 159, 0.08), transparent 45%),
        linear-gradient(0deg, rgba(215, 181, 109, 0.06), transparent 42%),
        #121416;
    overflow: hidden;
}

.bucket-zone.drag-over {
    border-color: var(--green);
    background:
        linear-gradient(135deg, rgba(142, 191, 159, 0.16), transparent 45%),
        linear-gradient(0deg, rgba(215, 181, 109, 0.08), transparent 42%),
        #171b18;
}

.bucket-zone.vomiting {
    border-color: rgba(217, 121, 121, 0.72);
    box-shadow: inset 0 0 30px rgba(217, 121, 121, 0.12), 0 0 24px rgba(217, 121, 121, 0.12);
}

.bucket-zone.vomiting .bucket-rim {
    border-color: rgba(217, 121, 121, 0.84);
    background: rgba(217, 121, 121, 0.08);
}

.bucket-zone.vomiting .bucket-liquid {
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.1) 0 8px, transparent 8px 18px),
        linear-gradient(180deg, rgba(215, 181, 109, 0.86), rgba(217, 121, 121, 0.82));
}

.bucket-rim {
    position: absolute;
    left: 50%;
    top: 10%;
    width: min(460px, 72%);
    height: 56px;
    transform: translateX(-50%);
    border: 2px solid rgba(142, 191, 159, 0.58);
    border-radius: 50%;
    background: rgba(142, 191, 159, 0.05);
}

.bucket-rim span {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: rgba(230, 237, 243, 0.78);
    font-size: 0.8rem;
    font-weight: 900;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    text-shadow: 0 1px 3px #000;
    pointer-events: none;
}

.bucket-core {
    position: absolute;
    left: 50%;
    top: calc(10% + 26px);
    width: min(420px, 66%);
    height: 72%;
    transform: translateX(-50%);
    border: 2px solid rgba(142, 191, 159, 0.35);
    border-top: 0;
    border-radius: 0 0 42px 42px;
    background: rgba(0, 0, 0, 0.22);
    overflow: hidden;
}

.bucket-label {
    position: relative;
    z-index: 2;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    text-align: center;
}

.bucket-warning-icon {
    width: clamp(58px, 16%, 96px);
    height: auto;
    margin-bottom: 8px;
    filter: drop-shadow(0 0 16px rgba(215, 181, 109, 0.45));
}

.bucket-warning-icon[hidden] {
    display: none;
}

.bucket-label strong {
    font-size: 1.6rem;
    letter-spacing: 0;
}

.bucket-label b {
    display: block;
    margin-top: 6px;
    color: var(--green);
    font-size: 1.12rem;
    letter-spacing: 0;
}

.bucket-label span {
    margin-top: 5px;
    color: var(--muted);
    font-weight: 700;
}

.bucket-liquid {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    height: 0%;
    background:
        repeating-linear-gradient(135deg, rgba(255, 255, 255, 0.08) 0 8px, transparent 8px 18px),
        linear-gradient(180deg, rgba(142, 191, 159, 0.85), rgba(201, 138, 85, 0.8));
    opacity: 0.74;
    transition: height 160ms ease;
}

.drink-cycle-panel {
    position: absolute;
    right: clamp(10px, 4%, 24px);
    top: 50%;
    z-index: 4;
    width: 168px;
    padding: 12px;
    display: grid;
    justify-items: center;
    gap: 9px;
    transform: translateY(-50%);
    border: 1px solid rgba(143, 182, 200, 0.34);
    border-radius: 8px;
    background:
        linear-gradient(180deg, rgba(143, 182, 200, 0.12), rgba(142, 191, 159, 0.08)),
        rgba(18, 20, 23, 0.9);
    box-shadow: 0 16px 34px rgba(0, 0, 0, 0.4), 0 0 24px rgba(143, 182, 200, 0.1);
    backdrop-filter: blur(14px);
}

.drink-cycle-panel[hidden] {
    display: none;
}

.drink-cycle-ring {
    position: relative;
    width: 98px;
    height: 98px;
}

.drink-cycle-ring svg {
    width: 100%;
    height: 100%;
    transform: rotate(-90deg);
}

.drink-cycle-track,
.drink-cycle-progress {
    fill: none;
    stroke-width: 8;
}

.drink-cycle-track {
    stroke: rgba(255, 255, 255, 0.09);
}

.drink-cycle-progress {
    stroke: var(--cyan);
    stroke-linecap: round;
    transition: stroke-dashoffset 120ms linear;
    filter: drop-shadow(0 0 8px rgba(143, 182, 200, 0.7));
}

.drink-cycle-ring strong {
    position: absolute;
    inset: 0;
    display: grid;
    place-items: center;
    color: var(--text);
    font-size: 1.22rem;
    letter-spacing: 0;
}

.drink-cycle-copy {
    text-align: center;
}

.drink-cycle-copy span,
.drink-cycle-copy b {
    display: block;
}

.drink-cycle-copy span {
    color: var(--text);
    font-size: 0.9rem;
    font-weight: 800;
}

.drink-cycle-copy b {
    margin-top: 3px;
    color: var(--muted);
    font-size: 0.76rem;
    letter-spacing: 0;
}

.drink-cycle-panel .text-button {
    width: 100%;
    border-color: rgba(217, 121, 121, 0.42);
    color: var(--red);
}

.game-hud-row {
    min-height: 132px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 34px;
}

.game-hud-card {
    --hud-color: var(--text);
    width: 70px;
    height: 132px;
    padding: 0;
    display: grid;
    grid-template-columns: 70px;
    grid-template-rows: 30px 64px 26px;
    row-gap: 6px;
    justify-items: center;
    align-items: center;
    background: transparent;
}

.hud-icon {
    grid-column: 1;
    grid-row: 2;
    width: 48px;
    height: 64px;
    color: var(--hud-color);
    overflow: visible;
    filter: drop-shadow(0 1px 1px #000) drop-shadow(0 0 8px color-mix(in srgb, var(--hud-color) 42%, transparent));
}

.hud-icon.thermometer {
    width: 44px;
}

.hud-icon-outline {
    fill: none;
    stroke: currentColor;
    stroke-width: 5.4;
    stroke-linecap: round;
    stroke-linejoin: round;
}

.hud-icon-outline.thin {
    stroke-width: 3.6;
    opacity: 0.78;
}

.hud-icon-fill {
    fill: currentColor;
    opacity: 0.78;
}

.hud-arrows {
    grid-column: 1;
    min-height: 16px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 1px;
    color: var(--hud-color);
    opacity: 0;
}

.hud-arrows.active {
    opacity: 1;
}

.hud-arrows.up {
    grid-row: 1;
    align-self: end;
    padding-bottom: 4px;
}

.hud-arrows.down {
    grid-row: 3;
    align-self: start;
    padding-top: 6px;
}

.hud-chevron {
    position: relative;
    width: 22px;
    height: 8px;
    flex: 0 0 8px;
    filter: drop-shadow(0 0 5px color-mix(in srgb, currentColor 55%, transparent));
}

.hud-chevron::before,
.hud-chevron::after {
    content: "";
    position: absolute;
    top: 2px;
    width: 13px;
    height: 4px;
    border-radius: 999px;
    background: currentColor;
}

.hud-arrows.up .hud-chevron::before {
    left: 0;
    transform: rotate(-28deg);
    transform-origin: right center;
}

.hud-arrows.up .hud-chevron::after {
    right: 0;
    transform: rotate(28deg);
    transform-origin: left center;
}

.hud-arrows.down .hud-chevron::before {
    left: 0;
    transform: rotate(28deg);
    transform-origin: right center;
}

.hud-arrows.down .hud-chevron::after {
    right: 0;
    transform: rotate(-28deg);
    transform-origin: left center;
}

.hud-copy {
    display: none;
}

.bucket-stat-row {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 12px;
}

.bucket-stat {
    min-height: 112px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 12px 14px 10px;
    background: #141619;
}

.bucket-stat-head {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    justify-content: flex-start;
    gap: 4px;
}

.bucket-stat span {
    display: block;
    color: var(--muted);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.bucket-stat strong {
    display: block;
    color: var(--text);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0.06em;
}

.bucket-stat.energy {
    border-left: 3px solid var(--amber);
}

.bucket-stat.hydration {
    border-left: 3px solid var(--cyan);
}

.bucket-stat.temperature {
    --temp-color: var(--muted);
    border-left: 3px solid var(--temp-color);
}

.bucket-stat-bar {
    margin-top: 10px;
    height: 10px;
    overflow: hidden;
    border-radius: 999px;
    background: #111312;
}

.bucket-stat-bar i {
    display: block;
    width: 0%;
    height: 100%;
    border-radius: inherit;
    transition: width 120ms ease;
}

.bucket-stat.energy .bucket-stat-bar i {
    background: var(--amber);
}

.bucket-stat.hydration .bucket-stat-bar i {
    background: var(--cyan);
}

.bucket-stat input[type="range"] {
    width: 100%;
    margin: 13px 0 0;
    accent-color: var(--green);
}

.temperature-control {
    min-height: 86px;
    margin-top: 10px;
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    gap: 10px;
    align-items: center;
}

.temperature-control input[type="range"] {
    width: 34px;
    height: 84px;
    margin: 0;
    accent-color: var(--temp-color);
    writing-mode: vertical-lr;
    direction: rtl;
}

.temperature-scale {
    height: 84px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    min-width: 0;
}

.temperature-scale span {
    color: var(--dim);
    font-size: 0.68rem;
    font-weight: 800;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.temperature-effect {
    display: block;
    min-height: 16px;
    color: var(--muted);
    font-size: 0.72rem;
    font-weight: 800;
    letter-spacing: 0;
}

.stomach-queue-wrap {
    min-height: 0;
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.text-button {
    min-height: 34px;
    padding: 0 12px;
    color: var(--muted);
    font-weight: 800;
}

.stomach-queue {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(190px, 1fr));
    gap: 10px;
    padding-right: 4px;
    scrollbar-width: thin;
}

.queue-item {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    background: #151619;
}

.queue-item strong,
.queue-item span {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.queue-item span {
    margin-top: 2px;
    color: var(--dim);
    font-size: 0.78rem;
}

.queue-progress {
    margin-top: 9px;
    height: 8px;
    overflow: hidden;
    border-radius: 999px;
    background: #111312;
}

.queue-progress i {
    display: block;
    width: 100%;
    height: 100%;
    background: var(--amber);
}

.trend-canvas {
    width: 100%;
    height: 210px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #111315;
}

.readout-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px;
}

.readout-grid div {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    background: #141619;
}

.readout-grid span {
    display: block;
    color: var(--dim);
    font-size: 0.78rem;
    font-weight: 700;
}

.readout-grid strong {
    display: block;
    margin-top: 4px;
    color: var(--text);
    font-size: 1.05rem;
}

.event-log {
    flex: 1 1 auto;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 8px;
    padding-right: 4px;
    scrollbar-width: thin;
}

.event-row {
    border-left: 3px solid var(--cyan);
    padding: 8px 10px;
    border-radius: 0 6px 6px 0;
    color: var(--muted);
    background: rgba(143, 182, 200, 0.06);
    font-size: 0.84rem;
}

.event-row strong {
    color: var(--text);
}

.digestion-footer {
    flex: 0 0 auto;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
}

.digestion-footer div {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 10px;
    background: #141619;
}

.digestion-footer span {
    display: block;
    color: var(--dim);
    font-size: 0.78rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.06em;
}

.digestion-footer strong {
    display: block;
    margin-top: 5px;
    font-size: 1.18rem;
    letter-spacing: 0;
}

.loading,
.empty-list {
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    padding: 16px;
    color: var(--muted);
    background: #141619;
}

.hydration-guide-modal[hidden] {
    display: none;
}

.hydration-guide-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: clamp(14px, 3vw, 34px);
}

.hydration-guide-backdrop {
    position: absolute;
    inset: 0;
    border: 0;
    background:
        radial-gradient(circle at 18% 16%, rgba(143, 182, 200, 0.2), transparent 34%),
        radial-gradient(circle at 82% 80%, rgba(215, 181, 109, 0.14), transparent 36%),
        rgba(5, 6, 7, 0.76);
    backdrop-filter: blur(10px);
}

.hydration-guide-window {
    position: relative;
    width: min(980px, 100%);
    max-height: min(820px, calc(100vh - 40px));
    overflow: auto;
    border: 1px solid rgba(255, 255, 255, 0.13);
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(34, 37, 41, 0.96), rgba(18, 20, 23, 0.98)),
        #181a1d;
    box-shadow: 0 30px 90px rgba(0, 0, 0, 0.62), inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.hydration-guide-titlebar {
    position: sticky;
    top: 0;
    z-index: 2;
    min-height: 52px;
    padding: 8px 14px;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 14px;
    align-items: center;
    border-bottom: 1px solid var(--line-soft);
    background: rgba(18, 20, 23, 0.94);
    backdrop-filter: blur(16px);
}

.window-dots {
    display: flex;
    gap: 7px;
    align-items: center;
}

.window-dots i {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--line);
}

.window-dots i:nth-child(1) {
    background: var(--red);
}

.window-dots i:nth-child(2) {
    background: var(--amber);
}

.window-dots i:nth-child(3) {
    background: var(--green);
}

.hydration-guide-titlebar h2 {
    font-size: 1.24rem;
}

.hydration-guide-close {
    min-height: 38px;
    border: 1px solid var(--line);
    border-radius: 7px;
    padding: 0 14px;
    color: var(--text);
    background: #1b1d20;
    font-weight: 800;
}

.hydration-guide-close:hover {
    border-color: rgba(217, 121, 121, 0.72);
    background: #242024;
}

.hydration-guide-hero {
    margin: 8px 14px 0;
    min-height: 58px;
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 10px;
    align-items: center;
    border: 1px solid rgba(143, 182, 200, 0.18);
    border-radius: 10px;
    padding: 8px 12px;
    background:
        linear-gradient(135deg, rgba(143, 182, 200, 0.13), transparent 48%),
        linear-gradient(315deg, rgba(142, 191, 159, 0.12), transparent 46%),
        #141619;
}

.hydration-guide-hero span {
    display: block;
    color: var(--green);
    font-size: 0.68rem;
    font-weight: 900;
    letter-spacing: 0.08em;
    text-transform: uppercase;
}

.hydration-guide-hero strong {
    display: block;
    margin-top: 4px;
    max-width: 720px;
    color: var(--text);
    font-size: clamp(0.92rem, 1.35vw, 1.12rem);
    line-height: 1.08;
}

.hydration-guide-hero img {
    width: clamp(44px, 5vw, 58px);
    height: auto;
    filter: drop-shadow(0 0 24px rgba(143, 182, 200, 0.22));
}

.hydration-guide-grid {
    padding: 8px 14px 14px;
    display: grid;
    grid-template-columns: minmax(0, 1fr);
    gap: 8px;
}

.hydration-guide-step {
    min-height: 0;
    display: grid;
    grid-template-columns: auto minmax(0, 1fr);
    gap: 10px;
    border: 1px solid var(--line-soft);
    border-radius: 9px;
    padding: 7px 10px;
    background: #141619;
}

.hydration-guide-step.featured {
    border-color: rgba(143, 182, 200, 0.3);
    background:
        linear-gradient(135deg, rgba(143, 182, 200, 0.1), transparent 52%),
        #141619;
}

.hydration-guide-step.final {
    border-color: rgba(215, 181, 109, 0.3);
    background:
        linear-gradient(135deg, rgba(215, 181, 109, 0.1), transparent 52%),
        #141619;
}

.guide-step-number {
    width: 34px;
    height: 34px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: #101113;
    background: var(--green);
    font-weight: 900;
}

.hydration-guide-step.featured .guide-step-number {
    background: var(--cyan);
}

.hydration-guide-step.final .guide-step-number {
    background: var(--amber);
}

.hydration-guide-step h3 {
    font-size: 0.98rem;
}

.hydration-guide-step p {
    margin-top: 5px;
    color: var(--muted);
    line-height: 1.25;
}

.guide-math {
    display: block;
    margin-top: 5px;
    border-left: 3px solid var(--green);
    padding: 4px 8px;
    border-radius: 0 7px 7px 0;
    color: var(--text);
    background: rgba(255, 255, 255, 0.04);
    line-height: 1.22;
}

.featured .guide-math {
    border-left-color: var(--cyan);
}

.final .guide-math {
    border-left-color: var(--amber);
}

.guide-status-image {
    display: block;
    width: min(72px, 100%);
    height: auto;
    margin-top: 5px;
    border: 1px solid var(--line-soft);
    border-radius: 8px;
    background: #0e1112;
}

@media (max-width: 1280px) {
    .sim-topbar {
        grid-template-columns: auto auto 220px 230px minmax(430px, 1fr);
        gap: 10px;
    }

    .page-nav {
        grid-column: auto;
    }

    .sim-controls {
        grid-column: auto;
        justify-content: flex-end;
    }

    .sim-shell {
        grid-template-columns: minmax(560px, 1fr) minmax(360px, 460px);
        height: auto;
    }
}

@media (max-width: 860px) {
    .sim-topbar,
    .sim-shell {
        position: static;
    }

    .sim-topbar {
        grid-template-columns: 1fr;
    }

    .sim-shell {
        grid-template-columns: 1fr;
        padding: 12px;
        height: auto;
    }

    .stomach-stage {
        grid-template-rows: auto minmax(260px, 360px) auto auto minmax(160px, auto);
    }

    .drink-cycle-panel {
        right: 12px;
        top: auto;
        bottom: 12px;
        width: 150px;
        transform: none;
    }

    .drink-cycle-ring {
        width: 82px;
        height: 82px;
    }

    .bucket-stat-row {
        grid-template-columns: 1fr;
    }

    .hydration-guide-titlebar {
        grid-template-columns: minmax(0, 1fr) auto;
    }

    .window-dots {
        display: none;
    }

    .hydration-guide-hero,
    .hydration-guide-step {
        grid-template-columns: 1fr;
    }

    .hydration-guide-hero img {
        justify-self: start;
    }
}
