/* Shared responsive layout for the public demo and the account notebook. */
main,header,.book,aside,.pages,.panel,aside nav{min-width:0}
.book{grid-template-columns:230px minmax(0,1fr)}
input,textarea,select{max-width:100%;min-width:0}
.days,.week{grid-template-columns:repeat(7,minmax(0,1fr))}
.days button{min-width:0}
.home-summary{grid-template-columns:repeat(3,minmax(0,1fr))}
.emotion-chart-row{grid-template-columns:100px minmax(0,1fr) 25px}
.page-top>label{max-width:100%;min-width:0}
.page-top input[type=date]{min-width:0;max-width:100%}
.panel p,.panel h2,.panel h3,.panel h4,.notice,.account-shell p{overflow-wrap:anywhere}
.account-shell{width:calc(100% - 28px)}
#journal-app #date{pointer-events:auto}

@media(max-width:960px){
  header{flex-wrap:wrap;padding:18px 20px;gap:12px}
  header>span{display:none}
  main{width:100%;padding:10px 16px 0}
  .book{grid-template-columns:minmax(0,1fr)}
  aside{padding:14px;border-right:0;border-bottom:1px solid var(--line)}
  .book-title,aside>p{display:none}
  aside nav{display:flex;width:100%;max-width:100%;gap:7px;overflow-x:auto;overscroll-behavior-x:contain;padding:3px 3px 9px;scroll-padding-inline:3px;scrollbar-width:thin;-webkit-overflow-scrolling:touch}
  aside nav button,.relaxation-nav{flex:0 0 auto;white-space:nowrap;padding:10px 14px;min-height:44px;line-height:1.4}
  .pages{padding:24px}
  .intro{min-height:0;gap:12px;padding:18px 6px 26px}
  .intro>div{min-width:0}
  .intro h1{font-size:clamp(30px,5.5vw,46px)}
  .journal-site-art{width:24%;min-width:0;max-width:180px}
  .home-welcome{padding-right:55px}
}

@media(max-width:600px){
  body{font-size:15px}
  header{padding:14px 14px 8px;gap:10px;font-size:12px}
  header>a{display:inline-flex;align-items:center;min-height:44px}
  .account-tools{margin-left:auto;gap:7px;max-width:100%;justify-content:flex-end}
  .account-tools button{font-size:12px;padding:9px 13px;min-height:44px}
  #account-email{display:none}
  main{padding:8px 10px 0}
  .intro{padding:14px 4px 22px;gap:8px}
  .intro h1{font-size:clamp(30px,8.5vw,40px);line-height:1.13;letter-spacing:-.04em}
  .intro .overline{font-size:9px;letter-spacing:.12em}
  .intro p{font-size:13px}
  .journal-site-art{width:23%;max-width:100px;align-self:flex-end;margin-bottom:12px}
  .notice{padding:12px 14px;margin-bottom:16px;font-size:11px}
  .book{border-radius:20px}
  aside{padding:10px 8px 4px}
  aside nav button,.relaxation-nav{padding:10px 12px;gap:7px;font-size:10px}
  aside nav button span,.relaxation-nav span{font-size:13px}
  .pages{padding:18px 14px 16px}
  .page-top{display:grid;grid-template-columns:minmax(0,1fr);gap:8px;padding-bottom:14px}
  .page-top>label{display:flex;align-items:center;justify-content:space-between;gap:8px;flex-wrap:wrap;letter-spacing:.06em}
  .page-top input[type=date]{margin:0;padding:7px 0;width:145px;min-height:44px;font-size:16px;letter-spacing:0}
  #status{text-align:left;max-width:100%;font-size:11px;letter-spacing:0}
  .panel{padding-top:24px;min-height:0}
  .panel h2,.home-welcome h2{font-size:clamp(27px,7.5vw,34px);line-height:1.18}
  .home-welcome{padding:0 30px 24px 0}
  .home-welcome>p{font-size:14px;line-height:1.7}
  .home-spark{font-size:46px;right:-4px;top:18px}
  .home-summary{gap:5px;padding:16px 0;margin-bottom:24px}
  .home-summary>div{padding:0 4px;min-width:0}
  .home-summary strong{font-size:28px}
  .home-summary span{display:block;font-size:10px;line-height:1.5;overflow-wrap:anywhere}
  .home-emotions,.home-calendar{padding:16px 12px;border-radius:18px}
  .home-calendar{margin-top:24px}
  .home-section-title{display:block}
  .home-section-title h3,.home-calendar h3{font-size:26px}
  .emotion-chart-row{grid-template-columns:82px minmax(0,1fr) 18px;gap:6px;font-size:11px}
  .month-nav{gap:5px}
  .month-nav h3{font-size:19px;text-align:center;min-width:0}
  .month-nav button{flex-shrink:0;padding:8px 11px}
  .days,.week{gap:3px}
  .days button{padding:4px 1px;min-height:44px;font-size:12px;line-height:1.3;border-radius:8px}
  .days button img{height:28px;border-radius:3px}
  .days button.chosen{outline-offset:0}
  .week{font-size:10px}
  .legend{gap:7px 10px;font-size:10px}
  .field{font-size:14px;margin:22px 0}
  .field input:not([type=range]),textarea,select{font-size:16px;padding:12px;max-width:100%}
  input[type=file]{width:100%;font-size:12px!important;overflow:hidden}
  .photo-upload{padding:14px}
  .weather-options{gap:6px}
  .weather-options button{font-size:12px;padding:9px 12px}
  .emotion-entry{padding:18px 15px}
  .emotion-entry>span{font-size:25px}
  .quote{padding:15px;font-size:17px}
  .theme-list{grid-template-columns:minmax(0,1fr)}
  .theme-card{padding:23px 18px}
  .theme-filters{gap:6px}
  .theme-filters button{white-space:normal;text-align:left}
  .guided-flow{gap:5px}
  .guided-flow span{padding:5px 8px;font-size:10px}
  .guided-flow span+span:before{margin-right:4px}
  .guided-steps{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:6px}
  .guided-steps button{padding:9px 8px;font-size:11px;white-space:normal}
  #guided-question{font-size:23px}
  .guided-actions{display:grid;grid-template-columns:minmax(0,1fr);gap:10px}
  .guided-actions button{width:100%}
  .tools{padding:8px;gap:6px}
  .tools button,.tools label{font-size:12px;min-height:44px}
  .tools label{min-width:0}
  .tools input[type=range]{width:75px}
  .tools input[type=color]{height:34px;width:34px}
  .framed-moment{width:min(100%,320px)}
  .polaroid-story{width:min(100%,360px);padding:0}
  .page-bottom{font-size:8px;gap:8px;letter-spacing:.06em}
  .account-shell{margin:20px auto;padding:26px 20px;border-radius:22px}
  .account-shell .field input{font-size:16px}
  button,.primary{min-height:44px}
  #emotion-dialog,#wheel-dialog{width:calc(100vw - 20px);max-width:calc(100vw - 20px);max-height:90vh;max-height:calc(100dvh - 24px);padding:16px 12px;border-radius:20px}
  .wheel-dialog-head{align-items:flex-start;gap:8px}
  .wheel-dialog-head>div{min-width:0}
  .wheel-dialog-head strong{font-size:21px}
  .wheel-dialog-head small{font-size:11px;line-height:1.6}
  .wheel-dialog-head>button{flex-shrink:0;padding:8px 10px;font-size:12px}
  #emotion-dialog .feeling-layout{grid-template-columns:minmax(0,1fr);gap:16px}
  #emotion-dialog .moods{grid-template-columns:repeat(3,minmax(0,1fr));gap:6px}
  #emotion-dialog .moods button{padding:10px 4px;min-width:0}
  #emotion-dialog .moods button b{font-size:16px}
  #emotion-dialog .moods button small{font-size:9px}
  .feeling-details{padding:14px 10px}
  .feeling-layout svg{width:100%;max-width:360px}
  #wheel-scroll{max-width:100%;max-height:62vh;overscroll-behavior:contain}
  .wheel-zoom-control{flex-wrap:wrap}
  main>footer{padding:24px 8px}
}

@media(max-width:360px){
  .journal-site-art{display:none}
  .intro h1{font-size:32px}
  .home-welcome{padding-right:0}
  .home-spark{display:none}
  .home-calendar,.home-emotions{padding:14px 10px}
  .home-summary span{font-size:9px}
  .month-nav h3{font-size:17px}
  .emotion-chart-row{grid-template-columns:76px minmax(0,1fr) 16px}
  .guided-flow span{padding:5px 6px;font-size:9px}
}
