.mobilebar, .mobile-shortcuts { display: none; }
.mobile-drawer {
  position: fixed; inset: 0 auto 0 0; margin: 0; border: 0;
  width: min(330px, 88vw); max-width: none; height: 100dvh; max-height: none;
  padding: 20px; color: #f3f6f0; background: #253e31;
  box-shadow: 8px 0 30px #14271d25; overflow-y: auto;
}
.mobile-drawer::backdrop { background: #15271e80; }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.drawer-heading strong { font-size: 25px; font-weight: 500; }
.drawer-heading small { display: block; font-size: 12px; color: #c4d1c6; letter-spacing: 2px; }
.drawer-heading button { min-width: 44px; min-height: 44px; background: transparent; color: white; border-color: #6a8170; font-size: 25px; }
.drawer-nav { display: grid; gap: 10px; margin-top: 30px; }
.drawer-nav button { min-height: 54px; padding: 13px 15px; text-align: left; background: #354f3f; color: #f5f8f2; border-color: #526c59; font-size: 17px; }
.drawer-nav button:hover, .drawer-nav button:focus-visible { background: #49694f; }
.drawer-nav button.drawer-primary { background: #f0f4e9; color: #294732; border-color: #f0f4e9; }
.drawer-note { font-size: 13px; line-height: 1.8; color: #c0cec2; margin-top: 28px; }

@media (max-width: 1000px) {
  body { font-size: 16px; }
  .mobilebar { display: flex; position: sticky; top: 0; z-index: 6; align-items: center; gap: 14px; padding: 8px 14px; background: #253e31; color: #f5f7f1; box-shadow: 0 2px 8px #19312215; }
  .mobilebar .mobile-brand { flex: 1; font-size: 22px; letter-spacing: .5px; line-height: 1.15; }
  .mobile-brand small { display: block; font-size: 11px; margin-bottom: 3px; color: #c0cec3; letter-spacing: 2px; }
  .mobilebar button { display: grid; place-items: center; background: transparent; color: white; border-color: #7a9180; width: 46px; height: 46px; padding: 8px; border-radius: 8px; }
  .mobilebar svg { width: 25px; height: 25px; }
  .mobilebar #mobileNew { font-size: 28px; line-height: 1; }
  .main { padding: 18px 14px 28px; }
  .main > .top { align-items: center; }
  .top h1 { font-size: 23px; }
  .top .eyebrow { display: none; }
  .todaylabel { font-size: 12px; }
  .todaylabel .desktop-brand { display: none; }
  .notice { font-size: 12px; line-height: 1.6; margin: 12px 0; align-items: flex-start; }
  .connectionbar { font-size: 12px; gap: 10px; flex-wrap: wrap; margin-bottom: 12px; }
  .connectionbar button { min-height: 40px; font-size: 14px; padding: 7px 12px; }
  .mobile-shortcuts { display: flex; gap: 10px; margin: 0 0 16px; }
  .mobile-shortcuts button { flex: 1; min-height: 44px; font-size: 15px; background: #edf2e8; border-color: #cfdbca; }
  .workspace { display: flex; flex-direction: column; gap: 18px; }
  .calendar { order: 2; width: 100%; scroll-margin-top: 82px; }
  .right { display: block; order: 1; width: 100%; margin: 0; scroll-margin-top: 82px; }
  .right .memory, .right .miniinfo { display: none; }
  #appShell[data-view="list"] .right { display: none; }
  .detailhead { padding: 18px 18px 12px; }
  .detailhead .eyebrow { font-size: 14px; }
  .detaildate { font-size: 24px; }
  .count { font-size: 14px; }
  .dayevents { padding: 0 17px 8px; max-height: none; overflow: visible; }
  .appointment { padding: 16px 0; }
  .time { font-size: 16px; margin-bottom: 7px; }
  .eventname { font-size: 19px; white-space: normal; overflow-wrap: anywhere; }
  .tag { font-size: 13px; padding: 2px 8px; }
  .place { font-size: 15px; }
  .prepline { font-size: 14px; }
  .addday { min-height: 46px; font-size: 16px; margin: 0 17px 17px; width: calc(100% - 34px); }
  .empty { font-size: 15px; }
  .toolbar { gap: 6px; padding: 13px 10px; }
  .month { flex: 1; font-size: 22px; white-space: nowrap; }
  .toolbar button { min-width: 40px; min-height: 44px; padding: 6px 10px; font-size: 15px; }
  .toolbar .arrow { font-size: 23px; }
  #newEvent { display: none; }
  .filters { gap: 10px; padding: 0 10px 12px; }
  .segmented { width: 100%; }
  .segmented button { flex: 1; min-height: 44px; font-size: 14px; padding: 6px; white-space: nowrap; }
  .view { width: 100%; }
  .view button { flex: 1; min-height: 42px; font-size: 14px; }
  .legend { gap: 8px 12px; padding: 0 10px 12px; font-size: 12px; }
  .week { font-size: 14px; }
  .day { min-height: 88px; padding: 5px 2px; }
  .date { width: 26px; height: 26px; font-size: 17px; }
  .dateline { display: block; padding: 0 2px; margin-bottom: 3px; }
  .rokuyo { display: block; font-size: 11px; line-height: 1.5; }
  .rokuyo.tomo { font-size: 15px; }
  .event { font-size: 11px; padding: 2px; margin: 2px 0; }
  .more { font-size: 10px; }
  .bottomnote, .savednote { font-size: 12px; line-height: 1.6; }
  .bottomnote { padding: 10px; }
  .agenda { padding: 0 14px; }
  .agenda h3 { font-size: 17px; }
  .searchbar { padding: 0 10px 14px; }
  .searchbar input { min-height: 46px; font-size: 16px; }
  .modal { padding: 0; }
  .dialog { width: 100%; height: 100dvh; max-height: 100dvh; border-radius: 0; padding: 0 18px; overscroll-behavior: contain; }
  .modalhead { position: sticky; top: 0; z-index: 1; background: white; margin-bottom: 16px; padding: max(12px, env(safe-area-inset-top)) 0 12px; border-bottom: 1px solid var(--line); }
  .modalhead h2 { font-size: 21px; }
  .modalhead button { width: 44px; height: 44px; }
  .formgrid, .prepgrid { grid-template-columns: minmax(0, 1fr); gap: 16px; }
  .formgrid > *, .formgrid input { min-width: 0; }
  label { font-size: 15px; }
  input, select, textarea { font-size: 16px; min-height: 46px; }
  input[type="checkbox"] { min-height: 20px; width: 20px; height: 20px; }
  .hint { font-size: 13px; color: #75826b; }
  .warning { font-size: 15px; }
  .actions { position: sticky; bottom: 0; z-index: 1; flex-wrap: wrap; background: white; padding: 12px 0 max(14px, env(safe-area-inset-bottom)); border-top: 1px solid var(--line); }
  .actions button { min-height: 46px; font-size: 16px; }
  .toast { width: min(360px, calc(100vw - 28px)); font-size: 15px; bottom: max(20px, env(safe-area-inset-bottom)); text-align: center; }
  .authscreen { padding: 18px; }
  .authbox { padding: 25px 22px; }
  .authbox .hint { font-size: 14px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; }
}
