/* =========================================================
   TaniAI — Design System (Compact, Clean & Refined)
   ========================================================= */
:root {
  --font-head: 'Outfit', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;

  --h-primary: 148;
  --primary: hsl(var(--h-primary) 62% 44%);
  --primary-strong: hsl(var(--h-primary) 70% 36%);
  --primary-soft: hsl(var(--h-primary) 60% 46% / .14);
  --accent: hsl(42 95% 55%);
  --accent-soft: hsl(42 95% 55% / .15);
  --soil: hsl(24 45% 48%);
  --sky: hsl(200 85% 58%);
  --danger: hsl(4 78% 58%);
  --danger-soft: hsl(4 78% 58% / .14);
  --warn: hsl(32 95% 54%);
  --warn-soft: hsl(32 95% 54% / .14);
  --info: hsl(205 85% 58%);
  --info-soft: hsl(205 85% 58% / .14);

  --bg: hsl(155 32% 5%);
  --bg-2: hsl(155 26% 8%);
  --surface: hsl(150 22% 11% / .75);
  --surface-solid: hsl(152 22% 10%);
  --surface-2: hsl(150 18% 15% / .75);
  --border: hsl(140 30% 80% / .08);
  --border-strong: hsl(140 30% 80% / .15);
  --text: hsl(120 20% 95%);
  --text-2: hsl(140 10% 74%);
  --muted: hsl(145 8% 52%);

  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 16px;
  --shadow: 0 8px 24px -10px hsl(160 60% 2% / .6);
  --shadow-glow: 0 6px 20px -6px hsl(var(--h-primary) 70% 45% / .45);
  --blur: saturate(160%) blur(16px);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --nav-h: 58px;
  color-scheme: dark;
}

[data-theme="light"] {
  --bg: hsl(80 30% 96%);
  --bg-2: hsl(90 25% 92%);
  --surface: hsl(0 0% 100% / .82);
  --surface-solid: hsl(0 0% 100%);
  --surface-2: hsl(100 25% 94% / .9);
  --border: hsl(150 30% 20% / .08);
  --border-strong: hsl(150 30% 20% / .16);
  --text: hsl(155 35% 10%);
  --text-2: hsl(155 12% 28%);
  --muted: hsl(150 8% 46%);
  --shadow: 0 6px 20px -10px hsl(150 40% 20% / .2);
  --primary-soft: hsl(var(--h-primary) 60% 40% / .12);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 13.5px;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  min-height: 100dvh;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body::before {
  content: '';
  position: fixed; inset: 0; z-index: -1;
  background:
    radial-gradient(800px 500px at 85% -10%, hsl(var(--h-primary) 70% 35% / .22), transparent 60%),
    radial-gradient(600px 450px at -10% 30%, hsl(42 90% 50% / .08), transparent 60%),
    radial-gradient(700px 500px at 50% 120%, hsl(180 60% 30% / .14), transparent 60%),
    var(--bg);
}
[data-theme="light"] body::before {
  background:
    radial-gradient(800px 500px at 85% -10%, hsl(var(--h-primary) 70% 60% / .2), transparent 60%),
    radial-gradient(600px 450px at -10% 30%, hsl(42 90% 60% / .15), transparent 60%),
    var(--bg);
}

h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.25; margin: 0 0 .35em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.3rem, 3.2vw, 1.65rem); font-weight: 700; }
h2 { font-size: 1.12rem; font-weight: 650; }
h3 { font-size: 0.96rem; font-weight: 600; }
h4 { font-size: 0.86rem; font-weight: 600; }
p { margin: 0 0 .65em; }
a { color: var(--primary); text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.muted { color: var(--muted); }
.small { font-size: .78rem; }
.text-2 { color: var(--text-2); }
.grad-text {
  background: linear-gradient(100deg, hsl(140 70% 65%), var(--accent));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}

/* ---------- Layout ---------- */
.app { display: flex; min-height: 100dvh; }
.main {
  flex: 1; min-width: 0;
  padding: 0 12px calc(var(--nav-h) + 20px + env(safe-area-inset-bottom));
}
.container { max-width: 900px; margin: 0 auto; }
.page { animation: pageIn .35s var(--ease) both; }
@keyframes pageIn { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 10px;
  padding: 8px 0; margin-bottom: 6px;
  background: linear-gradient(var(--bg) 50%, transparent);
}
.brand { display: flex; align-items: center; gap: 8px; font-family: var(--font-head); font-weight: 700; font-size: 1.05rem; color: var(--text); }
.brand img { width: 30px; height: 30px; border-radius: 8px; box-shadow: var(--shadow-glow); }
.topbar .spacer { flex: 1; }

.grid { display: grid; gap: 10px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.row { display: flex; gap: 8px; align-items: center; }
.row.wrap { flex-wrap: wrap; }
.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.stack > * { width: 100%; }
.between { justify-content: space-between; }
.mt { margin-top: 10px; } .mt-lg { margin-top: 18px; }

/* ---------- Sidebar (desktop) & Bottom nav (mobile) ---------- */
.sidebar { display: none; }
.bottom-nav {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(8px + env(safe-area-inset-bottom)); z-index: 40;
  width: min(520px, calc(100% - 16px)); height: var(--nav-h);
  display: grid; grid-template-columns: repeat(6, 1fr);
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border-strong); border-radius: 18px; box-shadow: var(--shadow);
  padding: 4px;
}
.nav-item {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  border-radius: 12px; color: var(--muted); font-size: .66rem; font-weight: 550;
  transition: color .2s, background .2s, transform .15s var(--ease);
}
.nav-item svg { width: 18px; height: 18px; }
.nav-item:active { transform: scale(.93); }
.nav-item.active { color: var(--primary); background: var(--primary-soft); font-weight: 650; }
[data-theme="dark"] .nav-item.active, :root:not([data-theme]) .nav-item.active { color: hsl(140 70% 65%); }

@media (min-width: 960px) {
  .bottom-nav { display: none; }
  .main { padding: 0 28px 36px; }
  .sidebar {
    display: flex; flex-direction: column; gap: 4px;
    position: sticky; top: 0; height: 100dvh; width: 220px; flex-shrink: 0;
    padding: 16px 12px; border-right: 1px solid var(--border);
    background: var(--surface); backdrop-filter: var(--blur);
  }
  .sidebar .brand { margin: 0 6px 18px; }
  .sidebar .nav-item {
    flex-direction: row; justify-content: flex-start; gap: 10px;
    padding: 9px 12px; font-size: .88rem; font-weight: 500;
  }
  .sidebar .foot { margin-top: auto; font-size: .74rem; color: var(--muted); padding: 0 6px; }
  .topbar .brand { display: none; }
}

/* ---------- Surfaces ---------- */
.card {
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow);
}
.card.pad-lg { padding: 18px; }
.card.flat { box-shadow: none; background: var(--surface-2); }
.card-title { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card-title .ico {
  width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; font-size: 1.05rem;
  background: var(--primary-soft); flex-shrink: 0;
}
.hover-lift { transition: transform .25s var(--ease), border-color .25s, box-shadow .25s; }
.hover-lift:hover { transform: translateY(-2px); border-color: var(--border-strong); box-shadow: var(--shadow), var(--shadow-glow); }

/* ---------- Buttons ---------- */
.btn {
  --b: var(--primary);
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  min-height: 38px; padding: 0 16px; border-radius: 11px; border: 0; cursor: pointer;
  font-weight: 600; font-size: .86rem; white-space: nowrap;
  color: #fff; background: linear-gradient(135deg, hsl(var(--h-primary) 65% 45%), hsl(165 70% 34%));
  box-shadow: var(--shadow-glow);
  transition: transform .15s var(--ease), filter .15s, box-shadow .2s;
}
.btn:hover { filter: brightness(1.08); transform: translateY(-1px); }
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .55; pointer-events: none; }
.btn.ghost { background: var(--surface-2); color: var(--text); box-shadow: none; border: 1px solid var(--border-strong); }
.btn.gold { background: linear-gradient(135deg, var(--accent), hsl(30 90% 50%)); color: hsl(30 60% 12%); box-shadow: 0 6px 18px -6px hsl(42 95% 50% / .5); }
.btn.sm { min-height: 30px; padding: 0 10px; font-size: .78rem; border-radius: 8px; }
.btn.block { width: 100%; }
.icon-btn {
  width: 36px; height: 36px; border-radius: 10px; display: grid; place-items: center; flex-shrink: 0;
  background: var(--surface-2); border: 1px solid var(--border); cursor: pointer; color: var(--text);
  transition: background .15s, transform .15s var(--ease);
}
.icon-btn:hover { background: var(--primary-soft); }
.icon-btn:active { transform: scale(.92); }
.icon-btn svg { width: 17px; height: 17px; }
.icon-btn.recording { background: var(--danger); color: #fff; animation: pulse 1.2s infinite; }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 hsl(4 78% 60% / .6); } 70% { box-shadow: 0 0 0 12px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }

/* ---------- Forms ---------- */
form.stack { display: flex; flex-direction: column; gap: 10px; width: 100%; }
.field { display: flex; flex-direction: column; gap: 4px; width: 100%; }
.field label { font-size: .78rem; font-weight: 600; color: var(--text-2); display: block; }
.input, .select, .textarea {
  width: 100%; min-height: 40px; padding: 8px 11px; border-radius: 10px;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--text);
  font-size: .88rem;
  transition: border-color .15s, box-shadow .15s;
}
.select { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='10' height='6' fill='none' stroke='%2388a' stroke-width='2'%3E%3Cpath d='m1 1 4 4 4-4'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }
.select option { background: var(--surface-solid); color: var(--text); }
.textarea { resize: vertical; min-height: 80px; }
.input:focus, .select:focus, .textarea:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px var(--primary-soft); }
.input-group { display: flex; gap: 6px; }
.input-group .input { flex: 1; }

.switch { display: inline-flex; align-items: center; gap: 8px; cursor: pointer; user-select: none; font-size: .8rem; color: var(--text-2); }
.switch input { display: none; }
.switch .track { width: 36px; height: 20px; border-radius: 99px; background: var(--border-strong); position: relative; transition: background .2s; }
.switch .track::after { content: ''; position: absolute; top: 2px; left: 2px; width: 16px; height: 16px; border-radius: 50%; background: #fff; transition: transform .2s var(--ease); }
.switch input:checked + .track { background: var(--primary); }
.switch input:checked + .track::after { transform: translateX(16px); }

/* Segmented / tabs */
.seg { display: inline-flex; padding: 3px; gap: 3px; border-radius: 10px; background: var(--surface-2); border: 1px solid var(--border); overflow-x: auto; max-width: 100%; }
.seg button {
  border: 0; background: transparent; padding: 6px 12px; border-radius: 8px; cursor: pointer;
  font-weight: 550; font-size: .8rem; color: var(--muted); white-space: nowrap; transition: all .2s var(--ease);
}
.seg button.active { background: var(--surface-solid); color: var(--text); box-shadow: 0 2px 8px -3px hsl(0 0% 0% / .4); font-weight: 650; }
.seg.organik button.active[data-v="organik"] { color: hsl(30 70% 55%); }

.chips { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 2px; scrollbar-width: none; }
.chips::-webkit-scrollbar { display: none; }
.chip {
  display: inline-flex; align-items: center; gap: 5px; flex-shrink: 0;
  padding: 5px 10px; border-radius: 99px; cursor: pointer; font-size: .78rem; font-weight: 500;
  background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2);
  transition: all .15s var(--ease);
}
.chip:hover { border-color: var(--border-strong); color: var(--text); }
.chip.active { background: var(--primary-soft); border-color: var(--primary); color: var(--text); font-weight: 600; }

.badge { display: inline-flex; align-items: center; gap: 3px; padding: 2px 7px; border-radius: 99px; font-size: .68rem; font-weight: 600; background: var(--primary-soft); color: hsl(140 60% 60%); }
[data-theme="light"] .badge { color: var(--primary-strong); }
.badge.gold { background: var(--accent-soft); color: var(--accent); }
[data-theme="light"] .badge.gold { color: hsl(35 80% 32%); }
.badge.danger { background: var(--danger-soft); color: var(--danger); }
.badge.warn { background: var(--warn-soft); color: var(--warn); }
.badge.info { background: var(--info-soft); color: var(--info); }

/* Alerts */
.alert { display: flex; gap: 8px; padding: 10px 12px; border-radius: 10px; border: 1px solid var(--border); background: var(--surface-2); font-size: .82rem; }
.alert .a-ico { font-size: 1.15rem; line-height: 1; flex-shrink: 0; }
.alert.ok { background: var(--primary-soft); border-color: hsl(var(--h-primary) 60% 45% / .3); }
.alert.warning { background: var(--warn-soft); border-color: hsl(32 95% 56% / .3); }
.alert.info { background: var(--info-soft); border-color: hsl(205 85% 60% / .3); }
.alert.danger { background: var(--danger-soft); border-color: hsl(4 78% 60% / .3); }
.alert b { display: block; margin-bottom: 2px; }

/* ---------- Hero ---------- */
.hero {
  position: relative; overflow: hidden; border-radius: var(--radius); min-height: 180px;
  padding: 18px; display: flex; flex-direction: column; justify-content: flex-end;
  background: url('../img/hero.jpg') center 40% / cover; border: 1px solid var(--border);
  box-shadow: var(--shadow);
}
.hero::before { content: ''; position: absolute; inset: 0; background: linear-gradient(15deg, hsl(155 50% 4% / .92) 15%, hsl(155 50% 5% / .35) 60%, transparent); }
.hero > * { position: relative; color: hsl(120 20% 96%); }
.hero h1 { font-size: 1.35rem; margin-bottom: 4px; }
.hero p { color: hsl(120 15% 85%); max-width: 440px; font-size: .82rem; line-height: 1.45; margin-bottom: 8px; }

/* Feature tiles */
.tiles { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
@media (min-width: 720px) { .tiles { grid-template-columns: repeat(4, 1fr); } }
.tile { display: flex; flex-direction: column; gap: 6px; padding: 12px; color: var(--text); border-radius: var(--radius); }
.tile .t-ico { width: 34px; height: 34px; border-radius: 9px; display: grid; place-items: center; font-size: 1.15rem; }
.tile b { font-family: var(--font-head); font-size: .88rem; }
.tile span { font-size: .74rem; color: var(--muted); line-height: 1.35; }

/* ---------- Chat ---------- */
.chat-wrap { display: flex; flex-direction: column; min-height: calc(100dvh - 160px); }
.chat-log { flex: 1; display: flex; flex-direction: column; gap: 10px; padding: 4px 0 12px; }
.msg { max-width: 90%; padding: 9px 13px; border-radius: 14px; animation: msgIn .25s var(--ease) both; word-wrap: break-word; font-size: .86rem; }
@keyframes msgIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
.msg.user { align-self: flex-end; color: #fff; border-bottom-right-radius: 4px; background: linear-gradient(135deg, hsl(var(--h-primary) 60% 42%), hsl(165 65% 32%)); }
.msg.model { align-self: flex-start; border-bottom-left-radius: 4px; background: var(--surface); border: 1px solid var(--border); backdrop-filter: var(--blur); }
.msg .meta { font-size: .68rem; color: var(--muted); margin-top: 4px; display: flex; gap: 6px; align-items: center; }
.msg img { border-radius: 10px; margin-bottom: 6px; max-height: 200px; }
.composer {
  position: sticky; bottom: calc(var(--nav-h) + 14px + env(safe-area-inset-bottom));
  display: flex; gap: 6px; align-items: flex-end; padding: 6px;
  background: var(--surface); backdrop-filter: var(--blur); -webkit-backdrop-filter: var(--blur);
  border: 1px solid var(--border-strong); border-radius: 14px; box-shadow: var(--shadow);
}
@media (min-width: 960px) { .composer { bottom: 12px; } }
.composer textarea { flex: 1; border: 0; background: transparent; resize: none; min-height: 36px; max-height: 130px; padding: 8px 6px; outline: none; font-size: .88rem; }
.typing { display: inline-flex; gap: 3px; padding: 3px 0; }
.typing i { width: 5px; height: 5px; border-radius: 50%; background: var(--primary); animation: blink 1.2s infinite; }
.typing i:nth-child(2) { animation-delay: .15s; } .typing i:nth-child(3) { animation-delay: .3s; }
@keyframes blink { 0%, 80%, 100% { opacity: .25; transform: translateY(0); } 40% { opacity: 1; transform: translateY(-2px); } }

/* Markdown */
.md > :last-child { margin-bottom: 0; }
.md h1, .md h2, .md h3, .md h4 { font-size: .92rem; margin: .6em 0 .25em; }
.md ul, .md ol { margin: .25em 0 .6em; padding-left: 1.2em; }
.md li { margin: .15em 0; }
.md strong { color: var(--text); }
.md code { background: var(--surface-2); padding: 1px 5px; border-radius: 5px; font-size: .84em; }
.md table { border-collapse: collapse; width: 100%; margin: .4em 0; font-size: .82em; }
.md th, .md td { border: 1px solid var(--border-strong); padding: 5px 7px; text-align: left; }

/* ---------- NPK ---------- */
.crop-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(82px, 1fr)); gap: 8px; }
.crop {
  display: flex; flex-direction: column; align-items: center; gap: 4px; padding: 9px 4px; cursor: pointer;
  border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border);
  font-size: .74rem; font-weight: 550; text-align: center; transition: all .2s var(--ease); color: var(--text-2);
}
.crop .em { font-size: 1.4rem; transition: transform .25s var(--ease); }
.crop:hover .em { transform: scale(1.12); }
.crop.active { border-color: var(--primary); background: var(--primary-soft); color: var(--text); box-shadow: var(--shadow-glow); font-weight: 650; }

.timeline { display: flex; gap: 6px; overflow-x: auto; padding: 3px 2px 8px; scrollbar-width: thin; }
.phase {
  flex: 0 0 auto; min-width: 125px; padding: 8px 10px; border-radius: var(--radius-sm); cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); text-align: left; position: relative;
  transition: all .2s var(--ease);
}
.phase small { display: block; color: var(--muted); font-size: .7rem; }
.phase b { font-size: .82rem; }
.phase.active { border-color: var(--accent); background: var(--accent-soft); }
.phase .num { position: absolute; top: 7px; right: 9px; font-family: var(--font-head); font-weight: 700; color: var(--muted); opacity: .45; font-size: .75rem; }

.npk-bars { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.npk-bar { padding: 8px; border-radius: var(--radius-sm); background: var(--surface-2); text-align: center; }
.npk-bar .lbl { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.npk-bar .meter { height: 5px; border-radius: 6px; background: var(--border); margin-top: 6px; overflow: hidden; }
.npk-bar .meter i { display: block; height: 100%; border-radius: 6px; transition: width .6s var(--ease); }
.n-col { color: hsl(140 65% 55%); } .n-bg { background: hsl(140 65% 50%); }
.p-col { color: hsl(275 70% 70%); } .p-bg { background: hsl(275 65% 62%); }
.k-col { color: hsl(30 90% 60%); } .k-bg { background: hsl(30 90% 56%); }

.rec-list { display: flex; flex-direction: column; gap: 8px; }
.rec { padding: 11px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); border-left: 3px solid var(--primary); font-size: .84rem; }
.rec.org { border-left-color: var(--soil); }
.rec-head { display: flex; justify-content: space-between; gap: 8px; align-items: baseline; flex-wrap: wrap; }
.rec-head b { font-size: .88rem; }
.rec-dose { font-weight: 700; color: var(--accent); font-size: .82rem; }
.rec p { margin: 4px 0 0; font-size: .8rem; color: var(--text-2); }

details.edu { border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); overflow: hidden; }
details.edu + details.edu { margin-top: 8px; }
details.edu summary { list-style: none; cursor: pointer; padding: 10px 12px; display: flex; gap: 8px; align-items: center; font-weight: 600; font-size: .86rem; }
details.edu summary::-webkit-details-marker { display: none; }
details.edu summary::after { content: '+'; margin-left: auto; font-size: 1.1rem; color: var(--muted); transition: transform .25s; }
details.edu[open] summary::after { transform: rotate(45deg); }
details.edu .body { padding: 0 12px 12px; font-size: .82rem; color: var(--text-2); }
details.edu .body dt { font-weight: 650; color: var(--text); margin-top: 6px; }
details.edu .body dd { margin: 2px 0 0; }

/* Calculator */
.result-table { width: 100%; border-collapse: collapse; font-size: .82rem; }
.result-table th { text-align: left; font-size: .7rem; text-transform: uppercase; letter-spacing: .05em; color: var(--muted); padding: 6px 4px; border-bottom: 1px solid var(--border-strong); }
.result-table td { padding: 9px 4px; border-bottom: 1px solid var(--border); }
.result-table td.num { text-align: right; font-variant-numeric: tabular-nums; font-weight: 600; }
.result-table tfoot td { font-weight: 700; border-bottom: 0; }
.pupuk-pick { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 6px; }
.pupuk-pick label {
  display: flex; gap: 8px; align-items: center; padding: 8px 10px; border-radius: 9px; cursor: pointer;
  background: var(--surface-2); border: 1px solid var(--border); font-size: .8rem; transition: all .15s;
}
.pupuk-pick label:has(input:checked) { border-color: var(--primary); background: var(--primary-soft); }
.pupuk-pick input { accent-color: var(--primary); width: 16px; height: 16px; }
.pupuk-pick small { display: block; color: var(--muted); font-size: .7rem; }
.big-num { font-family: var(--font-head); font-size: 1.6rem; font-weight: 700; line-height: 1; }

/* ---------- Hama ---------- */
.dropzone {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px;
  min-height: 140px; border-radius: var(--radius); cursor: pointer; text-align: center; padding: 14px;
  border: 1.5px dashed var(--border-strong); background: var(--surface-2); transition: all .2s;
  overflow: hidden;
}
.dropzone:hover, .dropzone.drag { border-color: var(--primary); background: var(--primary-soft); }
.dropzone .dz-ico { font-size: 1.8rem; }
.dropzone img.preview { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.dropzone .remove { position: absolute; top: 8px; right: 8px; z-index: 2; width: 30px; height: 30px; }
.confidence { height: 7px; border-radius: 6px; background: var(--border); overflow: hidden; }
.confidence i { display: block; height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--warn), var(--primary)); transition: width .8s var(--ease); }
.diag-head { display: flex; gap: 12px; align-items: flex-start; }
.diag-head img { width: 80px; height: 80px; object-fit: cover; border-radius: 12px; flex-shrink: 0; }
.step { display: flex; gap: 10px; }
.step + .step { margin-top: 10px; }
.step .s-num { flex-shrink: 0; width: 28px; height: 28px; border-radius: 8px; display: grid; place-items: center; font-weight: 700; font-family: var(--font-head); font-size: .85rem; }
.step ul { margin: 3px 0 0; padding-left: 1.1em; font-size: .82rem; color: var(--text-2); }
.obat { padding: 10px; border-radius: var(--radius-sm); background: var(--surface-2); border: 1px solid var(--border); margin-top: 6px; font-size: .8rem; }
.obat b { font-size: .88rem; }
.obat dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 8px; margin: 6px 0 0; }
.obat dt { color: var(--muted); }
.obat dd { margin: 0; }

/* ---------- Cuaca ---------- */
.wx-now { display: flex; align-items: center; gap: 12px; }
.wx-now .em { font-size: 2.8rem; line-height: 1; filter: drop-shadow(0 4px 12px hsl(42 95% 50% / .3)); }
.wx-now .temp { font-family: var(--font-head); font-size: 2.4rem; font-weight: 700; line-height: 1; }
.wx-stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 12px; }
.wx-stat { padding: 8px; border-radius: 10px; background: var(--surface-2); text-align: center; font-size: .74rem; color: var(--muted); }
.wx-stat b { display: block; font-size: .92rem; color: var(--text); margin-top: 2px; }
.hourly { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; }
.hour { flex: 0 0 62px; padding: 8px 4px; border-radius: 12px; text-align: center; background: var(--surface-2); border: 1px solid var(--border); font-size: .72rem; }
.hour .em { font-size: 1.3rem; margin: 2px 0; }
.hour b { display: block; font-size: .88rem; }
.hour .rain { color: var(--sky); font-size: .68rem; }
.daily-row { display: grid; grid-template-columns: 80px 28px 1fr auto; gap: 8px; align-items: center; padding: 8px 0; border-bottom: 1px solid var(--border); font-size: .82rem; }
.daily-row:last-child { border-bottom: 0; }
.temp-range { height: 5px; border-radius: 6px; background: linear-gradient(90deg, var(--sky), var(--accent)); opacity: .8; }

/* ---------- Misc ---------- */
.skeleton { position: relative; overflow: hidden; background: var(--surface-2); border-radius: 10px; min-height: 16px; }
.skeleton::after { content: ''; position: absolute; inset: 0; transform: translateX(-100%); background: linear-gradient(90deg, transparent, hsl(0 0% 100% / .06), transparent); animation: shimmer 1.4s infinite; }
@keyframes shimmer { to { transform: translateX(100%); } }

.toast-wrap { position: fixed; top: 12px; left: 50%; transform: translateX(-50%); z-index: 100; display: flex; flex-direction: column; gap: 6px; width: min(380px, calc(100% - 20px)); }
.toast { padding: 9px 13px; border-radius: 11px; background: var(--surface-solid); border: 1px solid var(--border-strong); box-shadow: var(--shadow); font-size: .82rem; animation: toastIn .25s var(--ease) both; display: flex; gap: 8px; align-items: center; }
.toast.error { border-left: 3px solid var(--danger); }
.toast.success { border-left: 3px solid var(--primary); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: 28px 12px; color: var(--muted); }
.empty .em { font-size: 2.2rem; margin-bottom: 6px; }

.list-item { display: flex; gap: 10px; align-items: center; padding: 9px 11px; border-radius: 11px; cursor: pointer; transition: background .15s; color: var(--text); font-size: .85rem; }
.list-item:hover { background: var(--surface-2); }
.list-item .li-ico { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--primary-soft); font-size: 1rem; flex-shrink: 0; }
.list-item .li-body { flex: 1; min-width: 0; }
.list-item .li-body b { display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-size: .86rem; }

.avatar { width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; font-weight: 700; font-size: .85rem; color: #fff; background: linear-gradient(135deg, var(--accent), var(--soil)); cursor: pointer; border: 0; flex-shrink: 0; }

.spinner { width: 16px; height: 16px; border-radius: 50%; border: 2px solid hsl(0 0% 100% / .35); border-top-color: #fff; animation: spin .7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

.section-head { display: flex; justify-content: space-between; align-items: end; gap: 10px; margin: 18px 0 8px; }
.section-head h2 { margin: 0; }

@media (max-width: 520px) {
  .grid-2.collapse, .grid-3.collapse { grid-template-columns: 1fr; }
  .card { padding: 12px; }
  .wx-now .temp { font-size: 2rem; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
