/* Mobile-first enhancement layer v0.11.0: a universal, touch-sized navigation shell.
   Original M00–M06 styles and behavior remain in place; this file only adds overrides. */
:root { --mobile-safe: env(safe-area-inset-bottom, 0px); }
.mobile-dock,.mobile-modules-dialog{display:none}
.mobile-quick-start{display:none}
/* Long JSON, filenames, numbers and labels must not force horizontal scrolling. */
pre,code{overflow-wrap:anywhere}
pre{max-width:100%;overflow-x:auto}
input,select,textarea,button{max-width:100%}
img,video,canvas{max-width:100%}
[hidden]{display:none!important}

@media (max-width:760px) {
  html{scroll-padding-top:78px}
  body{padding-bottom:calc(88px + var(--mobile-safe));-webkit-text-size-adjust:100%}
  body.mobile-menu-open{overflow:hidden}
  .container{max-width:100%;width:calc(100% - 30px)}
  .site-notice{font-size:10px;line-height:1.5;padding:6px 12px}
  .site-header{height:62px;top:0;z-index:21}
  .site-header .header-inner{min-width:0}
  .site-header .brand img{height:39px;width:39px;flex-basis:39px}
  .site-header .brand-copy strong{font-size:17px;white-space:nowrap}
  .site-header .brand-copy small{font-size:9px}
  .site-header .header-action{display:none}
  .hero-section{padding-top:30px}
  .hero-copy h1{font-size:clamp(34px,10vw,54px)}
  .hero-visual{margin-top:2px}
  .hero-lead{line-height:1.65}
  .feature-card{padding:21px;min-height:0}
  .section-pad{padding:48px 0}
  .mobile-quick-start{display:block;background:#f0f7eb;border-block:1px solid #dce9da;padding:20px 0 24px}
  .mobile-quick-eyebrow{font-size:10px;letter-spacing:.12em;font-weight:850;color:#346749;margin:0 0 13px}
  .mobile-quick-grid{display:grid;gap:9px}
  .mobile-quick-grid a{display:flex;align-items:center;gap:12px;background:#fff;padding:13px 15px;border:1px solid #dfeadd;border-radius:16px;min-height:71px;box-shadow:0 3px 10px #164c3a08}
  .mobile-quick-grid a>span:nth-child(2){flex:1;display:flex;flex-direction:column;min-width:0}
  .mobile-quick-grid strong{font-size:14px;line-height:1.3;color:#1e5037}
  .mobile-quick-grid small{font-size:11px;color:#6e8272;line-height:1.5}
  .mobile-quick-grid a>span:last-child{color:#377a50;font-size:19px}
  .quick-symbol{display:grid;place-items:center;flex:0 0 41px;width:41px;height:41px;border-radius:12px;background:#e6f2e2;color:#2e6546;font-size:21px}

  .mobile-dock{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));position:fixed;bottom:0;left:0;right:0;z-index:49;background:#fffefa;border-top:1px solid #dce9db;box-shadow:0 -8px 30px #123b2714;padding:7px max(8px,env(safe-area-inset-right,0px)) calc(7px + var(--mobile-safe)) max(8px,env(safe-area-inset-left,0px));min-height:calc(72px + var(--mobile-safe))}
  .mobile-dock-item{display:flex;align-items:center;justify-content:center;flex-direction:column;gap:1px;color:#5f7768;background:none;border:0;cursor:pointer;min-height:58px;border-radius:13px;min-width:0;padding:3px 1px;font:inherit;text-decoration:none;-webkit-tap-highlight-color:transparent}
  .mobile-dock-item.is-active{color:#175d3a;background:#e9f5e7;font-weight:850}
  .mobile-dock-item:focus-visible{outline:3px solid #5c9c75;outline-offset:1px}
  .mobile-dock-icon{height:28px;font-size:24px;line-height:28px;font-weight:850;display:block}
  .mobile-dock-label{font-size:11px;font-weight:750;line-height:1.3}
  .mobile-modules-dialog[open]{display:block;position:fixed;top:auto;bottom:0;left:0;right:0;margin:0 auto;padding:0;width:min(100%,560px);max-width:560px;max-height:min(88vh,780px);max-height:min(88dvh,780px);border:0;border-radius:24px 24px 0 0;overflow:auto;overscroll-behavior:contain;background:#fffcf6;box-shadow:0 -22px 90px #11382552;color:#1d4630;z-index:60}
  .mobile-modules-dialog::backdrop{background:rgba(6,30,17,.57);backdrop-filter:blur(3px)}
  .mobile-dialog-head{display:flex;align-items:center;justify-content:space-between;gap:14px;padding:22px 20px 15px;border-bottom:1px solid #e0e9db;position:sticky;top:0;background:#fffcf6;z-index:2}
  .mobile-dialog-overline{margin:0 0 2px;color:#477c58;font-size:10px;font-weight:850;letter-spacing:.1em}
  .mobile-dialog-head h2{margin:0;font-size:25px;line-height:1.25;letter-spacing:-.035em;color:#164831}
  .mobile-dialog-close{border:1px solid #cadcc9;background:#f3f8f0;color:#265a3b;font-weight:800;border-radius:12px;padding:10px 14px;min-width:78px;min-height:44px;cursor:pointer}
  .mobile-module-list{display:grid;gap:7px;padding:12px 13px}
  .mobile-module-link{display:flex;align-items:center;gap:12px;padding:12px;border-radius:15px;border:1px solid #e5ece0;background:#fff;min-height:69px;min-width:0;text-decoration:none}
  .mobile-module-link.is-current{border-color:#7caf89;background:#edf7e9}
  .mobile-module-icon{flex:0 0 43px;width:43px;height:43px;border-radius:12px;display:grid;place-items:center;background:#e8f2e4;color:#346a4a;font-size:23px;font-weight:900}
  .mobile-module-copy{display:flex;flex-direction:column;min-width:0;flex:1}
  .mobile-module-copy strong{font-size:14px;line-height:1.35;color:#23563c}
  .mobile-module-copy small{font-size:11px;line-height:1.4;color:#708674}
  .mobile-module-arrow{font-size:24px;color:#578668}
  .mobile-dialog-note{font-size:11px;line-height:1.6;margin:5px 18px calc(18px + var(--mobile-safe));color:#6d7f6c}

  /* All six original forms remain full featured, but become thumb-friendly. */
  .harvest-page,.grade-page,.storage-page,.risk-page,.journal-page,.priority-page{max-width:100%;min-width:0}
  .harvest-page input,.harvest-page select,.harvest-page textarea,
  .grade-page input:not([type=radio]):not([type=checkbox]):not([type=file]),.grade-page select,.grade-page textarea,
  .storage-page input,.storage-page select,.storage-page textarea,
  .risk-page input:not([type=radio]):not([type=checkbox]),.risk-page select,.risk-page textarea,
  .journal-page input:not([type=radio]):not([type=checkbox]),.journal-page select,.journal-page textarea,
  .priority-page input,.priority-page select,.priority-page textarea{font-size:16px}
  .harvest-page button,.grade-page button,.storage-page button,.risk-page button,.journal-page button,.priority-page button{min-height:44px}
  .harvest-page :is(pre,table),.grade-page :is(pre,table),.storage-page :is(pre,table),
  .risk-page :is(pre,table),.journal-page :is(pre,table),.priority-page :is(pre,table){max-width:100%}
  :is(.harvest-page,.grade-page,.storage-page,.risk-page,.journal-page,.priority-page) :is(pre,code){overflow-wrap:anywhere}
  :is(.harvest-page,.grade-page,.storage-page,.risk-page,.journal-page,.priority-page) table{display:block;overflow-x:auto;-webkit-overflow-scrolling:touch}
  :is(.harvest-page,.grade-page,.storage-page,.risk-page,.journal-page,.priority-page) :is(input,textarea,select){min-width:0}
  .grade-live-controls .button{min-height:49px}
}
@media (max-width:380px){
  .site-header .brand-copy strong{font-size:16px}
  .mobile-dock-label{font-size:10px}
  .mobile-quick-grid a{padding:10px 11px}
}
@media (prefers-reduced-motion: reduce){.mobile-dock,.mobile-modules-dialog{scroll-behavior:auto}}
@media print{.mobile-dock,.mobile-modules-dialog,.mobile-quick-start{display:none!important}body{padding-bottom:0!important}}
