/* =====================================================
   SusCalc — Frutiger Aero / Windows XP Nature Theme
   ===================================================== */

@import url('https://fonts.googleapis.com/css2?family=Trebuchet+MS&family=Tahoma&display=swap');

:root {
  --sky-top: #a8d8f0;
  --sky-mid: #c9eafc;
  --sky-bottom: #e8f7ff;
  --grass-green: #5cb85c;
  --leaf-green: #3a9e3a;
  --deep-green: #1e6b1e;
  --glass-white: rgba(255,255,255,0.55);
  --glass-border: rgba(255,255,255,0.85);
  --glass-shadow: rgba(100,180,100,0.25);
  --taskbar-h: 38px;
  --xp-title-start: #2a72d5;
  --xp-title-end: #5aacf5;
  --xp-title-stripe: #1a52a0;
  --xp-button-border: #1c5fa5;
  --text-dark: #1a2e1a;
  --text-mid: #2d4a2d;
  --input-bg: rgba(255,255,255,0.75);
  --hr-color: rgba(80,160,80,0.4);
}


/* =====================================================
   BOOT SCREEN
   ===================================================== */

#boot-screen {
  position: fixed;
  inset: 0;
  z-index: 999999;
  background: #000;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  transition: opacity 0.6s ease;
}

#boot-screen.fade-out {
  opacity: 0;
  pointer-events: none;
}

.boot-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  animation: bootFadeIn 0.5s ease-out;
}

@keyframes bootFadeIn {
  from { opacity: 0; transform: scale(0.96); }
  to   { opacity: 1; transform: scale(1); }
}

.boot-leaf {
  font-size: 64px;
  filter: drop-shadow(0 0 18px rgba(80, 220, 80, 0.7));
  animation: leafPulse 1.2s ease-in-out infinite alternate;
}

@keyframes leafPulse {
  from { filter: drop-shadow(0 0 10px rgba(80, 220, 80, 0.5)); transform: scale(1); }
  to   { filter: drop-shadow(0 0 26px rgba(80, 220, 80, 0.9)); transform: scale(1.06); }
}

.boot-title {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 36px;
  font-weight: bold;
  color: #fff;
  letter-spacing: 3px;
  text-shadow: 0 0 24px rgba(100, 240, 100, 0.5);
}

.boot-subtitle {
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  color: rgba(200, 230, 200, 0.75);
  letter-spacing: 2px;
  text-transform: uppercase;
  margin-top: -6px;
}

.boot-bar-wrap {
  width: 200px;
  height: 6px;
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 3px;
  margin-top: 24px;
  overflow: hidden;
}

.boot-bar {
  height: 100%;
  width: 0%;
  border-radius: 3px;
  background: linear-gradient(90deg, #3a9e3a, #8fd88f, #3a9e3a);
  background-size: 200% 100%;
  animation: bootProgress 1.8s ease-out forwards, barShimmer 0.8s linear infinite;
}

@keyframes bootProgress {
  0%   { width: 0%; }
  60%  { width: 70%; }
  85%  { width: 88%; }
  100% { width: 100%; }
}

@keyframes barShimmer {
  0%   { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

.boot-copy {
  font-family: 'Tahoma', sans-serif;
  font-size: 10px;
  color: rgba(180, 200, 180, 0.45);
  margin-top: 32px;
  letter-spacing: 0.5px;
}

*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

/* ── Desktop (full-screen canvas) ── */
html, body { height: 100%; overflow: hidden; }

body {
  font-family: 'Tahoma', 'Trebuchet MS', sans-serif;
  font-size: 13px;
  color: var(--text-dark);
}

#desktop {
  position: fixed;
  inset: 0 0 var(--taskbar-h) 0;
  overflow: hidden;
  background:
    radial-gradient(ellipse 120% 60% at 50% 0%, #ffffff55 0%, transparent 55%),
    linear-gradient(
      180deg,
      #5ea8e0 0%, #8fc8f0 18%, #b8e0fa 36%,
      #d4f0d4 55%, #7cc87c 72%, #4aaa4a 85%, #2e882e 100%
    );
}

/* Lens-flare orbs */
#desktop::before, #desktop::after {
  content: '';
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}
#desktop::before {
  width: 420px; height: 420px;
  top: -100px; left: -80px;
  background: radial-gradient(circle, rgba(255,255,255,0.35) 0%, transparent 70%);
  animation: orb1 14s ease-in-out infinite alternate;
}
#desktop::after {
  width: 280px; height: 280px;
  bottom: 60px; right: -60px;
  background: radial-gradient(circle, rgba(180,255,180,0.3) 0%, transparent 70%);
  animation: orb2 18s ease-in-out infinite alternate;
}
@keyframes orb1 { from { transform: translate(0,0) scale(1); } to { transform: translate(40px,60px) scale(1.15); } }
@keyframes orb2 { from { transform: translate(0,0) scale(1); } to { transform: translate(-30px,-50px) scale(1.2); } }

/* ── Leaf decorations ── */
.leaf-deco {
  position: absolute;
  font-size: 28px;
  opacity: 0.18;
  pointer-events: none;
  z-index: 0;
  animation: leafFloat 12s ease-in-out infinite alternate;
}
.leaf-deco:nth-child(1) { top: 12%; left: 4%;   animation-delay: 0s; }
.leaf-deco:nth-child(2) { top: 30%; right: 5%;  animation-delay: -4s; }
.leaf-deco:nth-child(3) { bottom: 18%; left: 7%; animation-delay: -7s; }
.leaf-deco:nth-child(4) { bottom: 10%; right: 10%; animation-delay: -2s; }
@keyframes leafFloat {
  from { transform: translateY(0) rotate(-8deg); }
  to   { transform: translateY(-18px) rotate(8deg); }
}

/* =====================================================
   XP WINDOW SYSTEM
   ===================================================== */

.xp-window {
  position: absolute;
  z-index: 10;
  min-width: 260px;
  max-width: 98vw;
  border-radius: 10px 10px 8px 8px;
  border: 1.5px solid var(--glass-border);
  background: var(--glass-white);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  box-shadow:
    0 8px 32px rgba(30,107,30,0.28),
    0 2px 8px rgba(0,80,160,0.18),
    inset 0 1px 0 rgba(255,255,255,0.9);
  overflow: hidden;
  transition: box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}

.xp-window.focused {
  box-shadow:
    0 12px 40px rgba(30,107,30,0.38),
    0 4px 12px rgba(0,80,160,0.28),
    inset 0 1px 0 rgba(255,255,255,0.9);
}

.xp-window.minimized .window-body { display: none !important; }
.xp-window.minimized { pointer-events: none; opacity: 0; transform: scale(0.92) translateY(20px); }

/* Window open/close animations */
@keyframes winOpen {
  from { opacity: 0; transform: scale(0.92) translateY(16px); }
  to   { opacity: 1; transform: scale(1) translateY(0); }
}
.xp-window { animation: winOpen 0.18s ease-out; }

/* ── Title bar ── */
.xp-window .title-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: default;
  user-select: none;
  flex-shrink: 0;
  background: linear-gradient(
    180deg,
    var(--xp-title-start) 0%,
    var(--xp-title-end) 60%,
    var(--xp-title-stripe) 61%,
    #1d6ad4 100%
  );
}

.xp-window.unfocused .title-bar {
  background: linear-gradient(180deg, #6a8ab4 0%, #8aaad4 60%, #5a7ab0 61%, #6a8ac0 100%);
}

.title-bar-icon { font-size: 15px; filter: drop-shadow(0 1px 1px rgba(0,0,0,0.5)); flex-shrink: 0; }

.title-bar-text {
  flex: 1;
  color: #fff;
  font-size: 12px;
  font-weight: bold;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  letter-spacing: 0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* XP window buttons */
.title-bar-buttons { display: flex; gap: 3px; flex-shrink: 0; }
.tb-btn {
  width: 21px; height: 21px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,0,0.45);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: bold;
  color: #222;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.7), inset 0 -1px 0 rgba(0,0,0,0.2);
  transition: filter 0.1s;
  line-height: 1;
}
.tb-btn:hover { filter: brightness(1.15); }
.tb-btn:active { filter: brightness(0.9); transform: translateY(1px); }
.tb-btn.minimize { background: linear-gradient(180deg, #f9f1a0 0%, #d4b800 100%); }
.tb-btn.maximize { background: linear-gradient(180deg, #b8f0b8 0%, #48a848 100%); }
.tb-btn.close    { background: linear-gradient(180deg, #f8b0b0 0%, #d42020 100%); color: #fff; }

/* ── Window body ── */
.window-body {
  padding: 20px 24px 24px;
  overflow-y: auto;
  max-height: calc(90vh - 80px);
}

/* ── Page heading ── */
h1 {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 22px;
  font-weight: bold;
  color: var(--deep-green);
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  margin-bottom: 4px;
}
.leaf-icon { margin-right: 6px; }
.subtitle {
  color: var(--text-mid);
  font-size: 12px;
  margin-bottom: 18px;
  opacity: 0.85;
}

/* ── Glass panel ── */
.glass-panel {
  background: linear-gradient(160deg, rgba(255,255,255,0.72) 0%, rgba(210,240,210,0.55) 100%);
  border: 1.5px solid rgba(255,255,255,0.8);
  border-radius: 8px;
  padding: 18px 20px;
  box-shadow: 0 2px 12px var(--glass-shadow), inset 0 1px 0 rgba(255,255,255,0.95);
  backdrop-filter: blur(6px);
}

/* ── Form fields ── */
.field-group { margin-bottom: 12px; }
label {
  display: block;
  font-weight: bold;
  font-size: 12px;
  color: var(--deep-green);
  margin-bottom: 4px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}
input[type="number"] {
  width: 100%;
  max-width: 220px;
  padding: 5px 9px;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  color: var(--text-dark);
  background: var(--input-bg);
  border: 1.5px solid rgba(90,160,90,0.55);
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08), 0 1px 0 rgba(255,255,255,0.9);
  outline: none;
  transition: border-color 0.2s, box-shadow 0.2s;
}
input[type="number"]:focus {
  border-color: #3a8adc;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08), 0 0 6px rgba(58,138,220,0.5);
}

/* ── XP Aqua button ── */
.xp-button {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 7px 20px;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  font-weight: bold;
  color: #0d3a0d;
  cursor: pointer;
  border-radius: 6px;
  border: 1.5px solid var(--xp-button-border);
  background: linear-gradient(180deg, #d4f5d4 0%, #8fd88f 30%, #5aba5a 65%, #3da03d 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.85) inset, 0 3px 8px rgba(30,107,30,0.35);
  transition: all 0.12s ease;
  text-shadow: 0 1px 0 rgba(255,255,255,0.5);
}
.xp-button:hover {
  background: linear-gradient(180deg, #e2fae2 0%, #a8e8a8 30%, #70ca70 65%, #52b452 100%);
  box-shadow: 0 1px 0 rgba(255,255,255,0.95) inset, 0 4px 12px rgba(30,107,30,0.45);
}
.xp-button:active {
  background: linear-gradient(180deg, #5aba5a 0%, #3da03d 50%, #5aba5a 100%);
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.2);
  transform: translateY(1px);
}

/* ── Status ── */
#status {
  margin-top: 12px;
  font-size: 12px;
  font-weight: bold;
  color: #1f5fa6;
  min-height: 18px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.7);
}

/* ── Results ── */
#results { margin-top: 16px; display: none; }
#results h2 {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 14px;
  color: var(--deep-green);
  margin-bottom: 10px;
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
}

.row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 4px 0;
  font-size: 12px;
  border-bottom: 1px dotted rgba(90,160,90,0.3);
}
.row:last-child { border-bottom: none; }
.row strong { color: var(--deep-green); min-width: 130px; }
.row span { color: var(--text-dark); font-weight: bold; }

hr { border: none; border-top: 2px solid var(--hr-color); margin: 8px 0; }

/* ── Calculator toolbar ── */
.calc-toolbar {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 12px;
  padding: 7px 10px;
  background: linear-gradient(180deg, rgba(255,255,255,0.65) 0%, rgba(210,235,210,0.5) 100%);
  border: 1.5px solid rgba(255,255,255,0.8);
  border-radius: 6px;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.9);
}
.toolbar-btn {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 12px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  border-radius: 4px;
  border: 1.5px solid #888;
  background: linear-gradient(180deg, #f4f4f4 0%, #d8d8d8 100%);
  color: #222;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.8), 0 1px 3px rgba(0,0,0,0.15);
  transition: filter 0.1s;
  white-space: nowrap;
}
.toolbar-btn:hover { filter: brightness(1.08); }
.toolbar-btn:active { filter: brightness(0.92); transform: translateY(1px); }
.toolbar-sep { width: 1px; height: 22px; background: rgba(0,0,0,0.15); margin: 0 4px; flex-shrink: 0; }
.input-mode-toggle { display: flex; align-items: center; gap: 7px; margin-left: auto; }
.toggle-label { font-size: 11px; color: var(--text-mid); font-weight: bold; white-space: nowrap; }
.toggle-group { display: flex; border: 1.5px solid rgba(90,160,90,0.6); border-radius: 4px; overflow: hidden; }
.toggle-opt {
  padding: 3px 10px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: bold;
  cursor: pointer;
  border: none;
  background: rgba(255,255,255,0.5);
  color: var(--text-mid);
  transition: background 0.12s, color 0.12s;
  white-space: nowrap;
}
.toggle-opt + .toggle-opt { border-left: 1px solid rgba(90,160,90,0.4); }
.toggle-opt.active { background: linear-gradient(180deg, #5aba5a 0%, #3da03d 100%); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.3); }
.toggle-opt:not(.active):hover { background: rgba(255,255,255,0.8); }

/* ── Field row ── */
.field-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 5px; }

/* Preset pills */
.preset-pills { display: flex; gap: 4px; flex-shrink: 0; }
.pill {
  padding: 4px 8px;
  font-family: 'Tahoma', sans-serif;
  font-size: 10px;
  line-height: 1.3;
  text-align: center;
  cursor: pointer;
  border: 1.5px solid rgba(90,160,90,0.5);
  border-radius: 5px;
  background: linear-gradient(180deg, rgba(255,255,255,0.8) 0%, rgba(210,240,210,0.7) 100%);
  color: var(--deep-green);
  font-weight: bold;
  transition: background 0.1s, border-color 0.1s, transform 0.08s;
  box-shadow: 0 1px 2px rgba(0,0,0,0.1);
  min-width: 40px;
}
.pill small { display: block; font-weight: normal; opacity: 0.75; font-size: 9px; }
.pill:hover { background: linear-gradient(180deg, #e2fae2 0%, #b8eab8 100%); border-color: var(--leaf-green); }
.pill:active { transform: scale(0.95); }
.pill.selected { background: linear-gradient(180deg, #70ca70 0%, #3da03d 100%); border-color: var(--deep-green); color: #fff; text-shadow: 0 1px 1px rgba(0,0,0,0.3); }
.pill.selected small { opacity: 0.9; }

/* XP slider */
.slider-wrap { display: flex; align-items: center; gap: 8px; flex: 1; min-width: 140px; }
.xp-slider {
  flex: 1;
  -webkit-appearance: none;
  appearance: none;
  height: 6px;
  border-radius: 3px;
  background: linear-gradient(180deg, #a0c8a0, #d4f0d4);
  border: 1px solid rgba(60,140,60,0.4);
  outline: none;
  cursor: pointer;
  box-shadow: inset 0 1px 2px rgba(0,0,0,0.15);
}
.xp-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f8e0 0%, #5aba5a 50%, #2e8a2e 100%);
  border: 1.5px solid #1e6b1e;
  box-shadow: 0 1px 4px rgba(0,0,0,0.3), inset 0 1px 0 rgba(255,255,255,0.6);
  cursor: pointer;
  transition: transform 0.1s;
}
.xp-slider::-webkit-slider-thumb:hover { transform: scale(1.15); }
.xp-slider::-moz-range-thumb {
  width: 16px; height: 16px;
  border-radius: 50%;
  background: linear-gradient(135deg, #e0f8e0 0%, #5aba5a 50%, #2e8a2e 100%);
  border: 1.5px solid #1e6b1e;
  cursor: pointer;
}
.slider-val {
  font-size: 11px;
  font-weight: bold;
  color: var(--deep-green);
  min-width: 70px;
  text-align: right;
  white-space: nowrap;
  background: rgba(255,255,255,0.5);
  border: 1px solid rgba(90,160,90,0.3);
  border-radius: 3px;
  padding: 2px 5px;
}

/* Precise number input */
.precise-wrap { display: flex; align-items: center; gap: 6px; flex: 1; }
.precise-input {
  flex: 1;
  max-width: 110px;
  padding: 5px 8px;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  color: var(--text-dark);
  background: var(--input-bg);
  border: 1.5px solid rgba(90,160,90,0.55);
  border-radius: 4px;
  box-shadow: inset 0 2px 4px rgba(0,0,0,0.08);
  outline: none;
  transition: border-color 0.2s;
}
.precise-input:focus { border-color: #3a8adc; box-shadow: inset 0 2px 4px rgba(0,0,0,0.08), 0 0 6px rgba(58,138,220,0.45); }
.precise-unit { font-size: 11px; color: var(--text-mid); white-space: nowrap; }
.form-actions { margin-top: 14px; }


/* =====================================================
   ECO HISTOGRAM
   ===================================================== */

/* ── Header / toggle row ── */
.histo-header {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 2px 0 10px;
  user-select: none;
}
.histo-header:hover .histo-title { color: var(--leaf-green); }

.histo-title {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 14px;
  font-weight: bold;
  color: var(--deep-green);
  text-shadow: 0 1px 0 rgba(255,255,255,0.8);
  transition: color 0.15s;
}

.histo-legend {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 10px;
  color: var(--text-mid);
  margin-left: 4px;
}
.legend-dot {
  display: inline-block;
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}
.legend-dot.red   { background: #c0392b; }
.legend-dot.green { background: #27ae60; }

.histo-chevron {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-mid);
  transition: transform 0.2s ease;
}
.histo-chevron.open { transform: rotate(180deg); }

/* ── Summary bars (always visible) ── */
.histo-summary {
  padding-bottom: 10px;
}
.histo-summary-label {
  font-size: 10px;
  font-weight: bold;
  color: var(--text-mid);
  text-transform: uppercase;
  letter-spacing: 0.5px;
  margin-bottom: 6px;
}
.histo-summary-bars { display: flex; flex-direction: column; gap: 5px; }

.histo-summary-row {
  display: flex;
  align-items: center;
  gap: 7px;
}
.histo-tag {
  font-size: 10px;
  font-weight: bold;
  width: 28px;
  text-align: center;
  padding: 1px 0;
  border-radius: 3px;
  flex-shrink: 0;
}
.histo-tag.you { background: #f5c6c4; color: #8b1a1a; }
.histo-tag.alt { background: #c6e8c6; color: #1a5c1a; }

.histo-track {
  flex: 1;
  height: 14px;
  background: rgba(0,0,0,0.07);
  border-radius: 3px;
  overflow: hidden;
  border: 1px solid rgba(0,0,0,0.08);
}
.histo-fill {
  height: 100%;
  border-radius: 3px;
  width: 0%;
  transition: width 0.7s cubic-bezier(0.4, 0, 0.2, 1);
}
.histo-fill.red   { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.histo-fill.green { background: linear-gradient(90deg, #2ecc71, #27ae60); }

.histo-kg {
  font-size: 10px;
  font-weight: bold;
  color: var(--text-dark);
  min-width: 72px;
  text-align: right;
  white-space: nowrap;
}

.histo-saving {
  margin-top: 8px;
  font-size: 11px;
  font-weight: bold;
  color: #1a6b1a;
  text-align: right;
  min-height: 14px;
}

/* ── Detail grid (expanded) ── */
.histo-detail {
  border-top: 1px dotted rgba(90,160,90,0.35);
  padding-top: 10px;
  margin-top: 4px;
  animation: histoSlideDown 0.2s ease-out;
}
@keyframes histoSlideDown {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: translateY(0); }
}

.histo-detail-grid { display: flex; flex-direction: column; gap: 2px; }

/* Each category row */
.histo-row {
  border-radius: 5px;
  overflow: hidden;
  border: 1px solid rgba(90,160,90,0.18);
  background: rgba(255,255,255,0.35);
  transition: background 0.15s;
}
.histo-row:hover { background: rgba(255,255,255,0.55); }

.histo-row-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 5px 8px;
  cursor: pointer;
  user-select: none;
}

.histo-row-icon { font-size: 14px; flex-shrink: 0; width: 18px; text-align: center; }
.histo-row-label {
  font-size: 11px;
  font-weight: bold;
  color: var(--deep-green);
  min-width: 80px;
}

.histo-row-bars {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 3px;
}
.histo-mini-row { display: flex; align-items: center; gap: 5px; }
.histo-mini-track {
  flex: 1;
  height: 8px;
  background: rgba(0,0,0,0.07);
  border-radius: 2px;
  overflow: hidden;
}
.histo-mini-fill {
  height: 100%;
  border-radius: 2px;
  width: 0%;
  transition: width 0.65s cubic-bezier(0.4, 0, 0.2, 1);
}
.histo-mini-fill.red   { background: linear-gradient(90deg, #e74c3c, #c0392b); }
.histo-mini-fill.green { background: linear-gradient(90deg, #2ecc71, #27ae60); }
.histo-mini-kg {
  font-size: 9px;
  color: var(--text-mid);
  min-width: 58px;
  text-align: right;
  white-space: nowrap;
}

.histo-row-arrow {
  font-size: 10px;
  color: var(--text-mid);
  flex-shrink: 0;
  transition: transform 0.18s;
}
.histo-row-arrow.open { transform: rotate(90deg); }

/* Expanded detail panel per category */
.histo-row-detail {
  display: none;
  padding: 6px 10px 8px 36px;
  background: rgba(220,245,220,0.4);
  border-top: 1px dotted rgba(90,160,90,0.25);
  font-size: 11px;
  color: var(--text-dark);
  line-height: 1.8;
}
.histo-row-detail.open { display: block; }
.histo-detail-line { display: flex; justify-content: space-between; }
.histo-detail-line span:first-child { color: var(--text-mid); }
.histo-detail-line span:last-child  { font-weight: bold; }
.histo-detail-change {
  margin-top: 4px;
  font-size: 10px;
  color: #1a6b1a;
  font-style: italic;
}

/* ── Eco tips ── */
.tip-item {
  padding: 6px 0;
  font-size: 12px;
  border-bottom: 1px dotted rgba(90,160,90,0.3);
  color: var(--text-dark);
  line-height: 1.5;
}
.tip-item:last-child { border-bottom: none; }

/* =====================================================
   TASKBAR
   ===================================================== */

#taskbar {
  position: fixed;
  bottom: 0; left: 0; right: 0;
  height: var(--taskbar-h);
  background: linear-gradient(180deg, #2a72d5 0%, #1a52a8 45%, #143e8a 46%, #1c58be 100%);
  border-top: 2px solid #5090e0;
  display: flex;
  align-items: center;
  padding: 0 8px;
  z-index: 9999;
  box-shadow: 0 -2px 8px rgba(0,0,0,0.4);
  gap: 4px;
}

.start-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 14px 3px 8px;
  border-radius: 14px;
  background: linear-gradient(180deg, #5cb85c 0%, #3a8a3a 50%, #2a6e2a 100%);
  border: 1.5px solid #1a4e1a;
  color: #fff;
  font-family: 'Tahoma', sans-serif;
  font-size: 12px;
  font-weight: bold;
  font-style: italic;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255,255,255,0.4), 0 2px 4px rgba(0,0,0,0.4);
  text-shadow: 1px 1px 2px rgba(0,0,0,0.6);
  white-space: nowrap;
  flex-shrink: 0;
  transition: filter 0.1s;
}
.start-btn:hover { filter: brightness(1.1); }
.start-btn:active { filter: brightness(0.9); }

/* Taskbar window buttons */
#taskbar-windows {
  display: flex;
  gap: 3px;
  flex: 1;
  overflow: hidden;
  align-items: center;
}

.taskbar-win-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 3px;
  border: 1px solid rgba(255,255,255,0.25);
  background: rgba(255,255,255,0.12);
  color: #fff;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  cursor: pointer;
  text-shadow: 1px 1px 1px rgba(0,0,0,0.4);
  white-space: nowrap;
  max-width: 160px;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: background 0.1s;
  height: 26px;
}
.taskbar-win-btn:hover { background: rgba(255,255,255,0.22); }
.taskbar-win-btn.active {
  background: rgba(0,0,0,0.25);
  border-color: rgba(0,0,0,0.35);
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.3);
}
.taskbar-win-btn.minimized-btn { opacity: 0.65; }

.taskbar-clock {
  margin-left: auto;
  color: #fff;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.5);
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  background: rgba(0,0,0,0.2);
  white-space: nowrap;
  flex-shrink: 0;
}

/* =====================================================
   START MENU
   ===================================================== */

#start-menu {
  position: fixed;
  bottom: var(--taskbar-h);
  left: 0;
  width: 260px;
  background: linear-gradient(135deg, #d4ecd4 0%, #c0e0f0 100%);
  border: 2px solid #1a52a0;
  border-radius: 8px 8px 0 0;
  box-shadow: 4px -4px 20px rgba(0,0,0,0.35);
  z-index: 99999;
  display: none;
  flex-direction: column;
  overflow: hidden;
  animation: menuSlideUp 0.15s ease-out;
}
#start-menu.open { display: flex; }

@keyframes menuSlideUp {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}

.start-menu-header {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  background: linear-gradient(90deg, #2a72d5, #5aacf5);
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.4);
}

.start-menu-items {
  padding: 6px 0;
  background: #fff;
  flex: 1;
}

.start-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 14px;
  font-size: 12px;
  color: #1a1a1a;
  cursor: pointer;
  transition: background 0.1s;
}
.start-menu-item:hover { background: #2a72d5; color: #fff; }
.start-menu-item .menu-icon { font-size: 16px; width: 20px; text-align: center; }
.start-menu-item .menu-label { font-weight: bold; }
.start-menu-item .menu-status {
  margin-left: auto;
  font-size: 10px;
  opacity: 0.6;
}

.start-menu-footer {
  padding: 6px 10px;
  background: linear-gradient(180deg, #c0d8f0, #90b8e0);
  border-top: 1px solid #7aaad0;
  display: flex;
  gap: 6px;
  justify-content: flex-end;
}

.start-menu-action {
  padding: 4px 10px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid rgba(0,0,80,0.3);
  background: linear-gradient(180deg, #e0f0ff, #b0d0f0);
  cursor: pointer;
  font-weight: bold;
  color: #1a3a6a;
}
.start-menu-action:hover { background: linear-gradient(180deg, #f0f8ff, #c8e4ff); }

/* =====================================================
   START BUTTON — LEAF REDESIGN
   ===================================================== */
.start-btn {
  width: 38px; height: 30px; padding: 0;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-style: normal; flex-shrink: 0;
}
.start-leaf {
  font-size: 22px; line-height: 1;
  filter: drop-shadow(0 0 6px rgba(80,220,80,0.7));
  transition: transform 0.18s, filter 0.18s;
  display: block;
}
.start-btn:hover .start-leaf {
  transform: scale(1.2) rotate(-10deg);
  filter: drop-shadow(0 0 12px rgba(80,220,80,1));
}

/* =====================================================
   FIELD HELP TOOLTIPS
   ===================================================== */
.field-help {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 15px; height: 15px;
  border-radius: 50%;
  background: linear-gradient(135deg, #4a9edc, #2a72d5);
  color: #fff;
  font-size: 9px;
  font-weight: bold;
  font-style: normal;
  cursor: pointer;
  margin-left: 6px;
  vertical-align: middle;
  border: none;
  box-shadow: 0 1px 3px rgba(0,0,80,0.3);
  flex-shrink: 0;
  transition: transform 0.1s;
}
.field-help:hover { transform: scale(1.15); }

#field-tip-box {
  display: none;
  position: fixed;
  z-index: 999999;
  max-width: 240px;
  background: #1b2e1b;
  border: 1.5px solid #4a9e4a;
  border-radius: 6px;
  padding: 10px 12px;
  font-family: 'Tahoma', sans-serif;
  font-size: 11px;
  font-weight: normal;
  line-height: 1.7;
  color: #d8f0d8;
  box-shadow: 0 4px 20px rgba(0,0,0,0.55);
  white-space: pre-line;
  pointer-events: none;
}

/* =====================================================
   FALLING ITEMS — top-right cluster
   ===================================================== */
#falling-zone {
  position: absolute;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;         /* behind windows */
}

.fall-item {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  pointer-events: all;
  cursor: grab;
  user-select: none;
  animation: fallDown var(--dur, 10s) linear forwards;
  will-change: transform, top;
}

@keyframes fallDown {
  0%   { transform: translateX(0)           rotate(0deg);   opacity: 0;   top: -60px; }
  5%   { opacity: 1; }
  50%  { transform: translateX(var(--wobble, 0px)) rotate(180deg); }
  95%  { opacity: 1; }
  100% { transform: translateX(0)           rotate(360deg); opacity: 0.3; top: calc(100vh - 60px); }
}

.fi-emoji {
  display: block;
  line-height: 1;
  filter: drop-shadow(1px 2px 4px rgba(0,0,0,0.3));
}
.fi-label {
  font-family: 'Tahoma', sans-serif;
  font-size: 9px;
  font-weight: bold;
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.9);
  background: rgba(0,0,0,0.3);
  border-radius: 2px;
  padding: 1px 3px;
  white-space: nowrap;
}
.fall-item:hover { filter: brightness(1.2); z-index: 200; }
.fall-item.fi-dragging {
  cursor: grabbing !important;
  filter: drop-shadow(0 4px 12px rgba(0,0,0,0.5));
  z-index: 9000 !important;
}


/* =====================================================
   TRASH COUNTER (in taskbar)
   ===================================================== */
#trash-counter {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 3px;
  background: rgba(0,0,0,0.25);
  flex-shrink: 0;
  white-space: nowrap;
}
#trash-counter-icon  { font-size: 13px; }
#trash-counter-num   { font-family:'Tahoma',sans-serif; font-size:12px; font-weight:bold; color:#fff; text-shadow:1px 1px 2px rgba(0,0,0,0.6); min-width:14px; }
#trash-counter-label { font-family:'Tahoma',sans-serif; font-size:10px; color:rgba(255,255,255,0.75); }
#trash-counter.counter-warning { background:rgba(160,80,0,0.5); border-color:rgba(255,150,0,0.5); }
#trash-counter.counter-danger  { background:rgba(140,0,0,0.6);  border-color:rgba(255,50,50,0.6); animation:counterPulse 0.9s ease infinite alternate; }
@keyframes counterPulse {
  from { box-shadow:0 0 0 rgba(255,0,0,0); }
  to   { box-shadow:0 0 10px rgba(255,80,80,0.8); }
}

/* =====================================================
   DESKTOP BINS — TOP RIGHT
   ===================================================== */
#bins-row {
  position: absolute;
  top: 12px; right: 14px;
  display: flex;
  flex-direction: row;
  gap: 16px;
  z-index: 5;
}

.desktop-bin {
  position: relative;
  width: 68px;
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  cursor: default; user-select: none;
  transition: transform 0.15s;
}
.desktop-bin:hover { transform: scale(1.08); }
.desktop-bin:hover .bin-tooltip { display: block; }

.bin-icon {
  font-size: 38px; line-height: 1;
  filter: drop-shadow(1px 2px 5px rgba(0,0,0,0.35));
  transition: transform 0.15s, filter 0.15s;
}
.bin-label {
  font-family:'Tahoma',sans-serif; font-size:11px; font-weight:bold;
  color:#fff; text-shadow:1px 1px 3px rgba(0,0,0,0.8),-1px -1px 0 rgba(0,0,0,0.4);
  text-align:center;
}
.bin-count {
  font-family:'Tahoma',sans-serif; font-size:10px;
  color:rgba(255,255,255,0.8); text-shadow:1px 1px 2px rgba(0,0,0,0.7);
  text-align:center; min-height:13px;
}

/* Tooltip drops DOWN from top position */
.bin-tooltip {
  display: none;
  position: absolute;
  top: 100%; right: 0;
  margin-top: 8px;
  width: 152px;
  background: rgba(15,25,15,0.93);
  border: 1px solid rgba(100,200,100,0.3);
  border-radius: 6px;
  padding: 8px 10px;
  font-family:'Tahoma',sans-serif;
  font-size:10px; line-height:1.7; color:#e8f8e8;
  box-shadow:0 4px 16px rgba(0,0,0,0.5);
  pointer-events:none; z-index:9999;
}
.bin-tooltip strong { color:#a0e8a0; display:block; margin-bottom:2px; }
.bin-tooltip em { color:rgba(255,220,100,0.9); font-style:normal; font-size:9px; }

#recycle-bin .bin-icon { filter: drop-shadow(0 0 6px rgba(60,140,255,0.5)); }
#trash-bin   .bin-icon { filter: drop-shadow(0 0 6px rgba(80,80,80,0.6)); }

.desktop-bin.bin-hover-correct .bin-icon { filter:drop-shadow(0 0 14px rgba(60,220,60,1)) !important; transform:scale(1.22); }
.desktop-bin.bin-hover-wrong   .bin-icon { filter:drop-shadow(0 0 14px rgba(220,50,50,1)) !important; transform:scale(1.12); }

.desktop-bin.bin-shake       { animation:binShake 0.4s ease; }
.desktop-bin.bin-shake-wrong { animation:binShakeWrong 0.4s ease; }
@keyframes binShake {
  0%,100%{transform:rotate(0);}20%{transform:rotate(-8deg);}40%{transform:rotate(8deg);}60%{transform:rotate(-5deg);}80%{transform:rotate(4deg);}
}
@keyframes binShakeWrong {
  0%,100%{transform:translateX(0);}20%{transform:translateX(-6px);}40%{transform:translateX(6px);}60%{transform:translateX(-4px);}80%{transform:translateX(4px);}
}

.bin-feedback {
  position:absolute; top:-30px; left:50%;
  transform:translateX(-50%);
  font-family:'Tahoma',sans-serif; font-size:11px; font-weight:bold;
  white-space:nowrap; pointer-events:none;
  animation:fbFloat 1.1s ease-out forwards; z-index:9999;
}
.bin-feedback.fb-correct { color:#00e676; text-shadow:0 0 8px rgba(0,200,100,0.8); }
.bin-feedback.fb-wrong   { color:#ff5252; text-shadow:0 0 8px rgba(255,0,0,0.7); }
@keyframes fbFloat {
  0%  {opacity:1;transform:translateX(-50%) translateY(0);}
  100%{opacity:0;transform:translateX(-50%) translateY(-28px);}
}


/* =====================================================
   MOBILE RESPONSIVE ADAPTATIONS
   max-width: 768px
   ===================================================== */

:root {
  --mobile-nav-h: 58px;
}

/* Mobile nav hidden on desktop */
#mobile-nav { display: none; }

@media (max-width: 768px) {

  /* ── Root override for taskbar height ── */
  :root {
    --taskbar-h: var(--mobile-nav-h);
  }

  /* ── Desktop canvas ── */
  #desktop {
    inset: 0 0 var(--mobile-nav-h) 0;
  }

  /* ── Leaf decorations — subtler on small screens ── */
  .leaf-deco {
    font-size: 18px;
    opacity: 0.08;
  }

  /* ── Windows become full-screen overlays ── */
  .xp-window {
    position: fixed !important;
    left: 0 !important;
    top: 0 !important;
    width: 100vw !important;
    height: calc(100vh - var(--mobile-nav-h)) !important;
    max-height: calc(100vh - var(--mobile-nav-h)) !important;
    border-radius: 0 !important;
    display: none !important;
    z-index: 200 !important;
    transform: none !important;
    animation: none !important;
    opacity: 1 !important;
    pointer-events: all !important;
    transition: none !important;
  }

  .xp-window.mobile-visible {
    display: flex !important;
    animation: mobileSlideUp 0.22s ease-out forwards !important;
  }

  @keyframes mobileSlideUp {
    from { opacity: 0.5; transform: translateY(18px); }
    to   { opacity: 1;   transform: translateY(0); }
  }

  /* Override minimized states — not relevant on mobile */
  .xp-window.minimized {
    display: none !important;
    pointer-events: none !important;
  }

  /* ── Title bar ── */
  .title-bar {
    cursor: default !important;
    padding: 9px 12px;
    touch-action: none;
  }
  .title-bar-text { font-size: 13px; }
  .tb-btn.minimize { display: none !important; }

  /* ── Window body ── */
  .window-body {
    padding: 14px 16px 24px;
    max-height: calc(100vh - var(--mobile-nav-h) - 42px);
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior: contain;
  }

  /* ── Taskbar → mobile chrome ── */
  #taskbar {
    height: var(--mobile-nav-h);
    padding: 0;
    gap: 0;
    justify-content: stretch;
  }
  .start-btn          { display: none !important; }
  .taskbar-clock      { display: none !important; }
  #taskbar-windows    { display: none !important; }
  #trash-counter {
    position: absolute;
    top: -28px;
    right: 8px;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 3px;
    z-index: 9999;
  }

  /* ── Mobile nav tabs ── */
  #mobile-nav {
    display: flex !important;
    flex: 1;
    height: 100%;
    align-items: stretch;
  }
  .mobile-tab {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 3px;
    padding: 6px 2px 4px;
    border: none;
    background: transparent;
    color: rgba(255, 255, 255, 0.6);
    cursor: pointer;
    font-family: 'Tahoma', 'Trebuchet MS', sans-serif;
    font-size: 9px;
    font-weight: bold;
    letter-spacing: 0.02em;
    border-top: 3px solid transparent;
    transition: color 0.15s, background 0.15s, border-color 0.15s;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .mobile-tab .tab-icon  { font-size: 22px; line-height: 1; display: block; }
  .mobile-tab .tab-label { display: block; text-transform: uppercase; }
  .mobile-tab.active {
    color: #fff;
    background: rgba(0, 0, 0, 0.28);
    border-top-color: #8fd88f;
  }
  .mobile-tab:active { background: rgba(0, 0, 0, 0.38); }

  /* ── Start menu — hidden on mobile ── */
  #start-menu { display: none !important; }

  /* ── Calculator toolbar ── */
  .calc-toolbar {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
    padding: 10px 12px;
  }
  .toolbar-btn {
    padding: 9px 14px;
    font-size: 12px;
    justify-content: center;
    border-radius: 6px;
  }
  .toolbar-sep { display: none !important; }
  .input-mode-toggle {
    margin-left: 0;
    justify-content: space-between;
  }
  .toggle-label { font-size: 12px; }
  .toggle-opt   { padding: 6px 16px; font-size: 12px; }

  /* ── Field groups ── */
  .field-group { margin-bottom: 16px; }
  label {
    font-size: 13px;
    margin-bottom: 6px;
  }

  .field-row {
    flex-direction: column;
    align-items: stretch;
    gap: 8px;
  }

  /* Preset pills — horizontal scroll */
  .preset-pills {
    display: flex;
    flex-direction: row;
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    gap: 6px;
    padding-bottom: 4px;
    /* hide scrollbar */
    scrollbar-width: none;
  }
  .preset-pills::-webkit-scrollbar { display: none; }

  .pill {
    padding: 9px 14px;
    font-size: 12px;
    min-width: 58px;
    flex-shrink: 0;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }
  .pill small { font-size: 10px; }

  /* Slider — full width, larger thumb */
  .slider-wrap {
    flex-direction: column;
    align-items: stretch;
    min-width: 0;
    gap: 6px;
    flex: none;
  }
  .xp-slider {
    height: 10px;
    cursor: pointer;
    touch-action: pan-y;
  }
  .xp-slider::-webkit-slider-thumb {
    width: 28px;
    height: 28px;
  }
  .xp-slider::-moz-range-thumb {
    width: 28px;
    height: 28px;
  }
  .slider-val {
    text-align: center;
    font-size: 13px;
    padding: 5px 8px;
    min-width: 0;
  }

  /* Precise input */
  .precise-wrap { flex-direction: row; align-items: center; gap: 8px; }
  .precise-input {
    max-width: 100%;
    flex: 1;
    font-size: 16px; /* prevent iOS zoom */
    padding: 9px 10px;
  }
  .precise-unit { font-size: 12px; flex-shrink: 0; }

  /* ── Calculate button ── */
  .xp-button {
    width: 100%;
    justify-content: center;
    padding: 13px 20px;
    font-size: 15px;
    border-radius: 8px;
    -webkit-tap-highlight-color: transparent;
    touch-action: manipulation;
  }

  /* ── Results ── */
  #results h2 { font-size: 15px; }
  .row { font-size: 12px; }
  .row strong { min-width: 110px; font-size: 11px; }
  .row span   { font-size: 11px; }

  /* ── Eco Histogram ── */
  .histo-detail-grid {
    overflow-x: auto !important;
    -webkit-overflow-scrolling: touch;
    min-width: min-content !important;
  }

  /* ── Page headings ── */
  h1 { font-size: 19px; }
  .subtitle { font-size: 12px; margin-bottom: 12px; }
  .glass-panel { padding: 14px 16px; }

  /* ── Bins — float above mobile nav, smaller ── */
  #bins-row {
    position: fixed;
    bottom: calc(var(--mobile-nav-h) + 8px);
    right: 8px;
    top: auto;
    gap: 8px;
    z-index: 190; /* below windows, above desktop */
  }
  .desktop-bin { width: 52px; }
  .bin-icon    { font-size: 28px; }
  .bin-label   { font-size: 10px; }
  /* No hover tooltips on mobile */
  .bin-tooltip { display: none !important; }

  /* ── Mobile game overlay ── */
  #mobile-game-overlay {
    position: fixed;
    top: 8px;
    left: 0;
    right: 0;
    padding: 8px 16px;
    z-index: 191;
    pointer-events: none;
  }
  #mobile-game-overlay.visible { display: flex !important; }
  .mobile-game-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(20, 40, 20, 0.75);
    border: 1px solid rgba(100, 200, 100, 0.35);
    border-radius: 8px;
    padding: 8px 14px;
    color: #d8f8d8;
    font-family: 'Tahoma', sans-serif;
    font-size: 12px;
    font-weight: bold;
    backdrop-filter: blur(8px);
    width: 100%;
  }
  #mobile-game-score { color: #8fd88f; }
  .mobile-game-hint {
    text-align: center;
    color: rgba(255,255,255,0.6);
    font-size: 11px;
    margin-top: 4px;
    font-family: 'Tahoma', sans-serif;
  }

  /* ── Falling items — larger on mobile for easier tapping ── */
  .fall-item { cursor: grab; }
  .fi-label  { font-size: 10px; }

  /* ── Field tip box — bottom-anchored on mobile ── */
  #field-tip-box {
    position: fixed !important;
    left: 50% !important;
    transform: translateX(-50%) !important;
    top: auto !important;
    bottom: calc(var(--mobile-nav-h) + 14px) !important;
    max-width: 92vw;
    font-size: 12px;
    line-height: 1.6;
    z-index: 999999;
  }

  /* ── Resource rows on mobile ── */
  .row a {
    font-size: 12px;
    word-break: break-word;
  }

}

/* Slightly wider breakpoint for tablet landscape */
@media (min-width: 769px) and (max-width: 1024px) {
  .xp-window { max-width: 96vw; }
}

/* =====================================================
   EARTHS NEEDED SECTION
   ===================================================== */

.earths-panel {
  text-align: center;
  padding: 18px 16px 14px;
}

.earths-header { margin-bottom: 14px; }

.earths-title {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 15px;
  font-weight: bold;
  color: var(--deep-green);
  letter-spacing: 0.3px;
}

.earths-formula {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 6px;
}

.formula-piece {
  background: rgba(255,255,255,0.7);
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: bold;
  color: var(--text-dark);
  box-shadow: inset 0 1px 2px rgba(255,255,255,0.6);
}

.formula-piece.formula-budget { color: var(--leaf-green); }

.formula-op {
  font-size: 16px;
  font-weight: bold;
  color: var(--text-mid);
  opacity: 0.7;
}

.formula-result {
  font-family: 'Trebuchet MS', sans-serif;
  font-size: 22px;
  font-weight: bold;
  color: var(--deep-green);
  min-width: 48px;
}

.formula-label {
  font-size: 12px;
  color: var(--text-mid);
  align-self: flex-end;
  padding-bottom: 3px;
}

.earths-budget-note {
  font-size: 10px;
  color: var(--text-mid);
  opacity: 0.75;
  margin: 0 0 12px;
}

.earths-verdict {
  display: inline-block;
  border-radius: 20px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: bold;
  margin-bottom: 16px;
  letter-spacing: 0.2px;
}

.earths-verdict.verdict-green  { background: rgba(60,160,60,0.18);  border: 1px solid rgba(60,160,60,0.45);  color: #1e6b1e; }
.earths-verdict.verdict-yellow { background: rgba(200,160,0,0.15);  border: 1px solid rgba(200,160,0,0.4);   color: #6b5500; }
.earths-verdict.verdict-orange { background: rgba(210,100,0,0.15);  border: 1px solid rgba(210,100,0,0.4);   color: #6b3000; }
.earths-verdict.verdict-red    { background: rgba(200,40,40,0.13);  border: 1px solid rgba(200,40,40,0.38);  color: #6b1010; }

.earths-globe-wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: flex-end;
  gap: 4px;
  margin-bottom: 10px;
  min-height: 52px;
}

.earth-globe {
  font-size: 36px;
  line-height: 1;
  display: inline-block;
  filter: drop-shadow(0 2px 4px rgba(0,100,0,0.25));
  animation: earthPop 0.35s cubic-bezier(0.175, 0.885, 0.32, 1.275) both;
}

@keyframes earthPop {
  from { opacity: 0; transform: scale(0.4) rotate(-15deg); }
  to   { opacity: 1; transform: scale(1)   rotate(0deg);   }
}

.earths-footer-note {
  font-size: 10px;
  color: var(--text-mid);
  opacity: 0.65;
  margin: 0;
}

@media (max-width: 768px) {
  .earth-globe    { font-size: 28px; }
  .formula-result { font-size: 18px; }
  .earths-formula { gap: 4px; }
}
