@media (max-width: 900px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .content-grid { grid-template-columns: 1fr; }
  .main { padding: 22px; }
  .sidebar { width: 200px; }
  .main { margin-left: 200px; width: calc(100% - 200px); }
}

.mobile-nav .nav-icon {
  display: grid;
  place-items: center;
  margin: 0 auto 3px;
  line-height: 1;
}

.nav .nav-icon,
.top-actions .icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.nav .nav-icon {
  width: 22px;
  height: 22px;
  margin-right: 9px;
  vertical-align: middle;
}

.nav .nav-icon svg {
  display: block;
  width: 19px;
  height: 19px;
}

.mobile-nav .nav-icon svg,
.top-actions .icon-btn svg {
  display: block;
  width: 21px;
  height: 21px;
}

.landing-language-control { display: none; }
.header-brand { display: flex; flex: 0 0 160px; width: 160px; }
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-width: 650px) {
  .landing {
    min-height: 100vh;
    min-height: 100svh;
    display: flex;
    flex-direction: column;
  }
  .hero {
    order: 0;
    flex: 1 0 auto;
    padding: 22px 24px 18px;
    align-items: center;
    text-align: center;
  }
  .hero .brand {
    align-self: center;
    margin: 0 0 10px;
  }
  .hero .brand-mark {
    flex-basis: 150px;
    width: 150px;
    height: 43px;
  }
  .hero .brand-mark img {
    top: -102px;
    left: -34px;
    width: 220px;
  }
  .eyebrow { margin: 9px 0 7px; }
  .hero h1 {
    margin: 4px 0 10px;
    font-size: clamp(31px, 9vw, 38px);
    line-height: 1.12;
  }
  .hero .intro {
    max-width: 340px;
    margin: 0 auto 16px;
    font-size: 14px;
    line-height: 1.5;
  }
  .hero-actions {
    width: min(100%, 245px);
    display: grid;
    gap: 8px;
  }
  .hero-actions .btn { width: 100%; min-height: 44px; }
  .lang-pills { display: none; }
  .landing-language-control {
    display: block;
    width: min(100%, 170px);
    margin-top: 10px;
  }
  .landing-language-control select {
    min-height: 38px;
    padding: 7px 12px;
    border-color: #d9eade;
    border-radius: 7px;
    background-color: #fff;
    font-size: 13px;
  }
  .art {
    order: 1;
    flex: 0 0 200px;
    min-height: 200px;
  }
  .art .sun { width: 82px; height: 82px; right: 32%; top: 12%; }
  .field { bottom: 14%; left: 8%; font-size: 34px; letter-spacing: 8px; }
  .sidebar { display:block; position:fixed; inset:0 auto 0 0; width:min(82vw,300px); height:100dvh; z-index:30; overflow-y:auto; transform:translateX(-102%); visibility:hidden; transition:transform .22s ease,visibility .22s ease; box-shadow:12px 0 32px #071d1133; }
  .shell.menu-open .sidebar { transform:translateX(0); visibility:visible; }
  .menu-toggle { display:grid; }
  .menu-backdrop { display:block; position:fixed; inset:0; z-index:29; border:0; background:#071d1170; opacity:0; visibility:hidden; pointer-events:none; transition:opacity .22s ease,visibility .22s ease; }
  .shell.menu-open .menu-backdrop { opacity:1; visibility:visible; pointer-events:auto; }
  .mobile-nav { display:flex; position:fixed; inset:auto 0 0; height:calc(70px + env(safe-area-inset-bottom)); padding:8px 6px env(safe-area-inset-bottom); justify-content:space-around; align-items:stretch; background:rgba(255,255,255,.97); border-top:1px solid #e4eee6; box-shadow:0 -5px 18px rgba(20,55,35,.08); z-index:10; }
  .main {
    margin: 0;
    width: 100%;
    padding: 18px 16px 102px;
  }
  .topbar h1 { font-size: 20px; }
  .topbar p { display: none; }
  .topbar { gap: 8px; }
  .topbar-heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .header-brand { display: flex; flex: 0 0 160px; width: 160px; }
  .header-brand .brand-mark { flex: 0 0 160px; width: 160px; height: 46px; }
  .header-brand .brand-mark img { top: -113px; left: -41px; width: 244px; max-width: none; height: auto; }
.cards { gap: 10px; }
  .stat { padding: 14px; }
  .stat strong { font-size: 20px; }
  .page-title h1 { font-size: 21px; }
  .form-grid, .report-grid { grid-template-columns: 1fr; }
  .full { grid-column: auto; }
  .panel { padding: 15px; }
  .auth { padding: 26px 18px; }
  .auth-card { margin: 35px 0; padding: 24px; }
  .form-links { flex-direction: column; }
  .list-item { padding: 10px; }
  .transaction-row { flex-wrap: wrap; }
  .transaction-row .item-main { flex: 1 1 calc(100% - 58px); }
  .transaction-row .amount { margin-left: 54px; }
  .art .sun { width: 75px; height: 75px; }
  .hero h1 { font-size: clamp(31px, 9vw, 38px); }
  .harvest-banner { min-height: 100px; padding: 16px; gap: 10px; }
  .harvest-banner:after { right: 2%; font-size: 82px; }
  .harvest-crop-mark { flex: 0 0 48px; width: 48px; height: 48px; font-size: 28px; }
  .harvest-workspace { padding: 14px 10px; }
  .harvest-workspace .panel-head { align-items: stretch; flex-direction: column; gap: 10px; }
  .harvest-workspace .panel-head .btn { width: 100%; }
  .harvest-workspace .harvest-table-wrap { max-width: 100%; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .harvest-workspace .harvest-table { min-width: 560px; }
  .harvest-workspace .form-actions { flex-wrap: wrap; gap: 8px; }
  .harvest-workspace .form-actions > * { flex: 1 1 100%; text-align: center; }
}

@media (max-width: 360px) {
  .cards { grid-template-columns: 1fr; }
  .top-actions .btn { padding: 9px; }
  .top-actions .btn span { display: none; }
  .hero { padding-right: 18px; padding-left: 18px; }
}

/* Compact mobile bill and harvest entry cards: no sideways table scrolling. */
@media(max-width:650px){.bill-table-panel .inline-bill-table tbody tr.bill-entry-row{grid-template-columns:repeat(3,minmax(0,1fr));gap:4px;padding:7px}.bill-table-panel .inline-bill-table tbody tr.bill-entry-row td:first-child{grid-column:1/-1;padding:2px 4px 5px;font-size:11px}.bill-table-panel .inline-bill-table tbody tr.bill-entry-row td:not(:first-child){align-items:stretch;padding:2px}.bill-table-panel .inline-bill-table tbody tr.bill-entry-row td:nth-child(2)::before{content:"Weight"}.bill-table-panel .inline-bill-table tbody tr.bill-entry-row td:nth-child(3)::before{content:"Rate"}.bill-table-panel .inline-bill-table tbody tr.bill-entry-row td:nth-child(4)::before{content:"Total"}.bill-table-panel .inline-bill-table tbody tr.bill-entry-row input{width:100%;min-height:38px}.header-brand .brand-mark img{object-fit:contain}.harvest-entry .form-grid{grid-template-columns:repeat(2,minmax(0,1fr))}.harvest-entry .form-grid .full{grid-column:1/-1}.harvest-entry input,.harvest-entry select,.harvest-entry textarea{min-height:42px}}

/* Refined mobile footer navigation */
@media(max-width:650px){.mobile-nav{height:calc(72px + env(safe-area-inset-bottom));padding:7px 5px env(safe-area-inset-bottom);border-top:1px solid #e4eee6;box-shadow:0 -5px 18px rgba(20,55,35,.07)}.mobile-nav a{gap:3px;color:#718176;font-weight:500;transition:color .18s ease}.mobile-nav .nav-icon{width:42px;height:30px;margin:0 auto;display:grid;place-items:center;border-radius:999px;background:transparent;transition:background-color .18s ease,transform .18s ease}.mobile-nav .nav-icon svg{width:22px;height:22px;stroke-width:2}.mobile-nav a.active{color:#087638;font-weight:700}.mobile-nav a.active .nav-icon{background:#e6f4e9;transform:translateY(-1px)}.mobile-nav small{font-size:10px;line-height:1.15;font-weight:inherit}.mobile-nav a:focus-visible{outline:2px solid #087638;outline-offset:-2px;border-radius:10px}}

/* Show the full Farmn artwork in the dashboard logo frames. */
.sidebar .brand-mark,.header-brand .brand-mark{flex:0 0 160px;width:160px;height:46px;overflow:hidden}.sidebar .brand-mark img,.header-brand .brand-mark img{position:absolute;top:-113px;left:-41px;width:244px;max-width:none;height:auto;object-fit:initial}

/* Keep the logo-matched cream color within the dashboard top navigation only. */
.dashboard-shell .topbar{background:#fbf8ed;padding:10px 16px;border-radius:12px}.dashboard-shell .sidebar>.brand{display:none}

@media(max-width:650px){.mobile-nav a{position:relative;flex:1 1 0;min-width:0;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;padding:2px;text-align:center}.mobile-nav .nav-icon{width:46px;height:34px;border-radius:13px;color:#47745a}.mobile-nav .nav-icon svg{width:23px;height:23px;stroke-width:2}.mobile-nav a.active .nav-icon{color:#fff;background:linear-gradient(135deg,#0b8742,#075f30);box-shadow:0 4px 12px #08763840;transform:translateY(-2px)}.mobile-nav small{font-size:10px;line-height:1.1;font-weight:600;color:#62766a}.mobile-nav a.active small{color:#075f30}.mobile-nav .badge{top:1px;right:calc(50% - 26px);z-index:1}}



@media (max-width: 650px) { .menu-toggle { display: none !important; } }

@media(max-width:650px){.mobile-nav{background:#fff;z-index:20}.main{padding-bottom:calc(112px + env(safe-area-inset-bottom));scroll-padding-bottom:calc(112px + env(safe-area-inset-bottom))}}
