/* Shared action sizing, then a dedicated layout for narrow screens. */
.workspace-actions{align-items:stretch;gap:10px}
.workspace-actions .button{min-width:144px;min-height:44px;padding:10px 16px;border:1px solid var(--line);font-size:13px;line-height:22px;gap:9px}
.workspace-actions .button-primary{border-color:var(--ink)}
.workspace-actions .button-primary>span{font-size:18px;line-height:1}
.mobile-brand,.mobile-calendar-hint{display:none}
.profile-back{display:inline-flex;align-items:center;min-height:44px;margin-bottom:18px;font-size:13px}
.restaurant-editor{margin-top:0}
.event-date-label{margin:22px 0 10px;font-size:13px;line-height:1.6}
.event-date-options{display:grid;grid-template-columns:repeat(3,minmax(0,1fr));gap:8px;margin-bottom:16px}
.event-date-options button{position:relative;display:flex;flex-direction:column;align-items:flex-start;justify-content:flex-start;gap:7px;min-width:0;min-height:104px;padding:35px 12px 13px;border:1px solid #d7ddcf;border-radius:9px;background:#fff;text-align:left;color:var(--ink);font-size:12px;line-height:1.5;transition:background .15s,border-color .15s}
.event-date-options button::before{content:'';position:absolute;top:12px;left:12px;width:14px;height:14px;border:1.5px solid #b6beaf;border-radius:50%;background:#fff}
.event-date-options button[aria-pressed="true"]{border-color:#58734d;background:#edf3e7;box-shadow:inset 0 0 0 1px #58734d;color:#293c22}
.event-date-options button[aria-pressed="true"]::before{border-color:#58734d;background:#58734d;box-shadow:inset 0 0 0 3px #edf3e7}
.event-date-options button:hover{border-color:#7b8d6e}
.event-mode-title{font-weight:650}
.event-mode-description{font-size:11px;font-weight:400;color:#68735f}
.calendar-plan-title,.restaurant-contacts>*{min-width:0;overflow-wrap:anywhere}
.period-row .open-end-label>span,.period-row .next-day-label>span,.weekday-picks .weekday-chip span{color:var(--ink)}

@media(max-width:760px){
  html{scrollbar-gutter:auto;scroll-padding-bottom:100px}
  body{font-size:15px;-webkit-text-size-adjust:100%}
  .workspace{display:block;min-height:100dvh}
  .main{display:flex;flex-direction:column;max-width:620px;min-width:0;margin-inline:auto;padding:18px 16px calc(100px + env(safe-area-inset-bottom))}
  .main>*{min-width:0}
  .account-tools{order:-2;display:grid;grid-template-columns:minmax(0,1fr) auto;gap:7px 12px;align-items:center;margin:0 0 17px;font-size:11px}
  .mobile-brand{display:inline-flex;align-items:center;justify-self:start;font-size:32px;font-weight:650;letter-spacing:-.075em;line-height:1.2;min-height:44px}
  .mobile-brand span{color:var(--accent)}
  .account-tools #cloud-state{grid-column:1/-1;grid-row:2;font-size:11px;line-height:1.6;overflow-wrap:anywhere}
  .account-tools .zimmis-account{grid-row:1;grid-column:2;margin-left:0}
  .account-tools .za-panel button{font-size:13px;padding:12px 0;min-height:44px}
  .restaurant-context{order:-1;display:block;margin:0 0 22px;padding:0;border:0}
  .restaurant-context>div:first-child{display:none}
  .restaurant-switch{width:100%;max-width:none}
  .restaurant-switch label{font-size:12px;margin-bottom:7px}
  .restaurant-switch select{font-size:16px;min-height:46px;width:100%;background:#fff;border-radius:8px}
  .workspace-header{display:block;margin-bottom:18px}
  .workspace-header h1{font-size:32px;margin:7px 0 9px}
  .eyebrow{font-size:10px;line-height:1.7}
  .subtitle{font-size:13px;max-width:none;line-height:1.7}
  .workspace-actions{display:flex;flex-wrap:nowrap;gap:10px;width:100%;margin-top:18px}
  .workspace-actions .button{flex:1;min-width:0;min-height:46px;padding:10px 8px;font-size:13px;white-space:normal}
  .sidebar{position:fixed;inset:auto 0 0;z-index:50;display:block;width:100%;height:auto;padding:7px max(12px,env(safe-area-inset-right)) calc(7px + env(safe-area-inset-bottom)) max(12px,env(safe-area-inset-left));border-top:1px solid #41503e;box-shadow:0 -5px 24px #20301c0d;overflow:visible}
  .sidebar .brand,.sidebar-label,.sidebar-bottom{display:none}
  .sidebar nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:8px;max-width:590px;margin:auto}
  .sidebar .nav-item{display:flex;flex-direction:row;align-items:center;justify-content:center;gap:10px;min-height:50px;padding:10px 8px;font-size:13px;line-height:1.4;border-radius:8px}
  .sidebar .nav-item svg{width:21px;height:21px}
  .sidebar .nav-item>span{display:none}
  body:has(dialog[open]) .sidebar{visibility:hidden}
  .planning-scope-bar{display:block;padding:0;border:0;background:none;margin:0 0 18px}
  .planning-scope-bar>div:first-child{display:none}
  .planning-scope-switch{display:grid;grid-template-columns:1fr 1fr;width:100%;padding:4px;gap:4px}
  .scope-button{min-width:0;min-height:46px;padding:9px 6px;font-size:12px;line-height:1.5;white-space:normal}
  .scope-internal{display:none}
  .calendar-layout{display:flex;flex-direction:column;gap:20px}
  .calendar-layout>.calendar-section,.calendar-layout>.day-section{width:100%;min-width:0;position:static}
  .calendar-layout>.calendar-section{order:-1}
  .calendar-layout .calendar-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:10px;padding:12px}
  .calendar-layout .month-nav{display:grid;grid-template-columns:36px minmax(0,1fr) 36px;gap:3px;min-width:0}
  .calendar-layout .month-nav h2{min-width:0;font-size:15px;letter-spacing:-.03em;line-height:1.4}
  .calendar-layout .month-nav .icon-button{width:36px;height:44px}
  .calendar-layout .calendar-tools{margin:0;gap:0}
  .calendar-tools>.button{min-height:44px;padding:9px 10px;font-size:12px}
  .calendar-layout .month-count{display:none}
  .calendar-scroll{overflow:visible}
  .calendar{width:100%;min-width:0;table-layout:fixed}
  .calendar th{height:36px;text-align:center;padding:0;font-size:11px}
  .calendar-layout .calendar-day{height:70px;min-height:70px;padding:5px 1px 4px;align-items:center;text-align:center}
  .calendar-layout .day-top{display:flex;flex-direction:column;justify-content:flex-start;gap:3px;width:100%;min-height:55px;margin:0}
  .day-number{font-size:13px;width:27px;height:27px;flex-shrink:0}
  .day-entry-count{font-size:10px;min-width:19px;height:18px;padding:0 4px}
  .calendar-layout .cell-hours,.calendar-layout .day-chips,.calendar-layout .planning-calendar-badge,.calendar-layout .calendar-plan-title{display:none}
  .calendar-layout .calendar-day.is-loading>.day-number{margin-top:2px}
  .calendar-layout .calendar-day.outside-month .day-number{opacity:.55}
  .calendar-layout .calendar-day.is-selected{box-shadow:inset 0 0 0 2px #344c39}
  .calendar-layout .calendar-footer{padding:12px;gap:8px;font-size:11px}
  .calendar-layout .calendar-footer>span:last-child{display:none}
  .calendar-legend{gap:15px}
  .legend-dot{width:8px;height:8px}
  .mobile-calendar-hint{display:block;border-top:1px solid var(--line);font-size:11px;color:var(--muted);line-height:1.6;padding:10px 12px;margin:0;background:#fafbf8}
  .calendar-load-state{font-size:12px;padding:12px;align-items:flex-start;flex-wrap:wrap}
  .calendar-layout>.day-section{padding:18px 16px;scroll-margin-top:16px}
  .calendar-layout .day-heading{gap:8px;margin-bottom:14px}
  .calendar-layout .day-heading h2{font-size:20px;line-height:1.4;margin:5px 0 0}
  .calendar-layout .day-hours-summary{padding:12px 14px}
  .calendar-layout .day-hours-summary strong{font-size:14px}
  .day-hours-summary div>span{font-size:12px}
  .text-button,.day-heading>.text-button,.day-hours-summary .text-button,.dish-actions .text-button,.planning-actions .text-button{min-height:44px;display:inline-flex;align-items:center;font-size:13px;padding:9px 0;line-height:1.6}
  .filter-label{font-size:12px}
  .planning-filters{gap:8px}
  .planning-filter{min-height:44px;padding:10px 13px;font-size:12px}
  .filter-hint,.filter-summary{font-size:12px;line-height:1.7}
  .calendar-layout .planning-heading{align-items:center;gap:10px}
  .calendar-layout .planning-heading h3,.calendar-layout .day-dishes-section>h3{font-size:17px}
  .calendar-layout .planning-heading .button{min-height:44px;font-size:12px;padding:10px 12px}
  .calendar-layout .dish-card,.calendar-layout .planning-card{padding:14px}
  .calendar-layout .dish-title h3,.planning-card-top h4{font-size:16px;line-height:1.5}
  .dish-price{font-size:14px}
  .dish-copy p,.planning-description{font-size:13px;line-height:1.8}
  .calendar-layout .planning-meta,.planning-event-dates,.planning-progress{font-size:12px;line-height:1.7}
  .planning-actions,.dish-actions{gap:22px;flex-wrap:wrap}
  .empty-day strong{font-size:15px}
  .empty-day p,.dialog-empty,.planning-note,.hours-hint{font-size:13px;line-height:1.8}
  .shopping-checklist li{min-height:48px;gap:10px}
  .shopping-checklist label{min-height:44px;font-size:14px;gap:10px}
  .shopping-quantity{font-size:13px;max-width:90px}
  .planning-card-top>input,.shopping-checklist input{width:21px;height:21px;flex-basis:21px}
  .workspace-footer{font-size:11px;gap:7px;padding:24px 0 0}
  .setup-banner{padding:18px;gap:15px}
  .setup-banner strong{font-size:15px}
  .setup-banner p{font-size:13px}
  .setup-banner .button{min-height:46px;font-size:13px;white-space:normal}
  .restaurants-toolbar{gap:14px;margin-bottom:18px}
  .restaurants-toolbar h2{font-size:23px}
  .restaurants-toolbar p{font-size:13px}
  .restaurants-toolbar>.button{min-height:46px;width:100%;font-size:13px}
  .restaurant-card{padding:18px}
  .restaurant-card h3{font-size:21px}
  .restaurant-card-top p,.restaurant-description,.restaurant-contacts{font-size:13px}
  .restaurant-marker{font-size:11px}
  .restaurant-schedule{font-size:12px;grid-template-columns:75px minmax(0,1fr);gap:10px}
  .restaurant-card-actions{display:grid;grid-template-columns:1fr;gap:10px}
  .restaurant-card-actions .button{min-height:46px;font-size:13px;white-space:normal}
  .restaurant-editor{padding:18px 14px;scroll-margin-top:16px}
  .restaurant-editor>h2{font-size:24px;margin-bottom:24px}
  .profile-back{margin:0 0 18px}
  .weekly-heading h3{font-size:18px}
  .weekly-heading p{font-size:13px}
  .grouped-week{gap:16px}
  .weekday-group{padding:14px 12px}
  .weekday-group-title{font-size:16px}
  .weekday-group-head{gap:8px}
  .weekday-group-head .text-button{font-size:12px}
  .weekday-picks{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:7px}
  .weekday-chip span{display:flex;align-items:center;justify-content:center;min-height:44px;padding:8px;font-size:13px}
  .weekday-presets{display:flex;gap:12px;margin:8px 0 14px}
  .weekday-presets .text-button{font-size:12px}
  .hours-mode-label{font-size:12px}
  .weekday-group .period-row,.period-row{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px;padding:13px 0;border-bottom:1px solid var(--line)}
  .weekday-group .time-label,.time-label,.day-hours-editor .time-label{width:100%;min-width:0;max-width:none;font-size:12px}
  .open-end-label,.next-day-label{min-height:44px;white-space:normal;font-size:12px;gap:8px;line-height:1.6}
  .open-end-label input,.next-day-label input{width:20px;height:20px;flex-shrink:0}
  .period-row .icon-button{grid-column:2;justify-self:end;margin:0;width:44px;height:44px}
  .period-fields>.text-button{font-size:13px}
  .season-range,.closure-range{display:grid;grid-template-columns:minmax(0,1fr);padding:14px;gap:14px}
  .season-range label,.closure-range label{font-size:13px;line-height:1.6}
  .season-countdown{font-size:13px}
  .schedule-check{font-size:14px;min-height:44px;align-items:flex-start}
  .schedule-check input{width:21px;height:21px;margin-top:2px}
  .opening-schedule-editor h3{font-size:20px}
  .opening-schedule-editor h4{font-size:16px}
  .weekly-group-footer .button{min-height:46px;font-size:13px;white-space:normal}
  input:not([type=checkbox]),select,textarea,.plan-dialog input:not([type=checkbox]),.plan-dialog textarea,.plan-dialog select,.time-label input{width:100%;max-width:100%;min-width:0;min-height:46px;padding:11px 12px;font-size:16px;line-height:1.5;border-radius:7px}
  textarea{min-height:112px}
  label,.plan-dialog label{font-size:13px;line-height:1.6}
  .optional{font-size:11px}
  .form-row,.profile-form-grid{grid-template-columns:minmax(0,1fr);gap:18px}
  .form-row>div{min-width:0}
  .button{min-height:44px;font-size:13px}
  .icon-button{width:44px;height:44px;flex-shrink:0}
  .day-dialog,.plan-dialog,.hours-dialog{width:calc(100% - 16px);max-width:620px;max-height:calc(100dvh - 16px);margin:8px auto;padding:0;border-radius:14px;scroll-padding-block:90px 80px}
  .dialog-header,.plan-dialog .dialog-header{position:sticky;top:0;z-index:2;padding:17px 16px;background:#fcfcf8;gap:12px}
  .dialog-header h2{font-size:22px;margin-top:6px;line-height:1.4}
  .dialog-content,.hours-dialog-content{padding:0 16px 18px}
  .plan-dialog form{padding:4px 16px 18px}
  .plan-dialog .form-row{margin:0;gap:0}
  .form-actions,.restaurant-editor .form-actions{display:flex;flex-direction:column-reverse;align-items:stretch;gap:10px;margin-top:24px;padding-top:18px}
  .form-actions .button,.restaurant-editor .form-actions .button{width:100%;min-height:48px;font-size:14px;white-space:normal;padding:12px 14px}
  .day-dialog form h3{font-size:19px}
  .dialog-dishes .dish-copy p{font-size:13px}
  .plan-dialog .inline-check{min-height:44px;font-size:13px}
  .plan-dialog input[type=checkbox]{width:21px;height:21px;flex-shrink:0}
  .planning-item-editor{grid-template-columns:minmax(0,1fr) 44px;gap:9px;padding:13px 0;border-bottom:1px solid var(--line)}
  .planning-item-editor .item-text{grid-column:1}
  .planning-item-editor .item-quantity{grid-column:1;grid-row:2}
  .planning-item-editor .icon-button{grid-column:2;grid-row:1/3;align-self:center}
  .event-date-options{grid-template-columns:minmax(0,1fr);gap:8px}
  .event-date-options button{display:grid;grid-template-columns:minmax(0,1fr);gap:2px;min-height:68px;padding:12px 12px 12px 43px;font-size:14px;align-content:center}
  .event-date-options button::before{top:25px;left:14px;width:17px;height:17px}
  .event-mode-description{font-size:12px}
  .event-date-range.is-range{grid-template-columns:minmax(0,1fr);gap:0}
  .event-date-row{grid-template-columns:minmax(0,1fr) 44px;gap:9px}
  .event-date-label{margin-top:22px;font-size:13px}
  .plan-dialog h3{font-size:15px}
  .hours-profile-note p{font-size:13px}
  .hours-profile-note .button{width:100%;white-space:normal;font-size:13px;min-height:46px}
  .hours-dialog-footer .button{width:100%;font-size:13px}
  .toast{left:12px;right:12px;bottom:calc(84px + env(safe-area-inset-bottom));max-width:none;width:auto;gap:10px;font-size:13px}
  .toast button{min-height:36px;font-size:12px}
  .warning{font-size:13px;overflow-wrap:anywhere}
  .auth-gate{min-height:100dvh;padding:28px 20px}
  .auth-gate>.button{width:100%;max-width:360px;min-height:48px;font-size:14px;white-space:normal}
}
@media(max-width:360px){
  .main{padding-inline:12px}
  .calendar-layout .calendar-toolbar{padding:9px 7px;gap:6px}
  .calendar-layout .month-nav h2{font-size:13px}
  .calendar-layout .month-nav{grid-template-columns:30px minmax(0,1fr) 30px}
  .calendar-layout .month-nav .icon-button{width:30px}
  .calendar-tools>.button{padding-inline:8px}
  .workspace-actions .button{font-size:12px}
  .scope-button{font-size:11px}
}

/* Secondary navigation remains readable and above transient status messages. */
.sidebar #nav-team svg{stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
@media(max-width:760px){
  .sidebar .nav-secondary #nav-team>span{display:inline;min-width:0}
  .sidebar:has(#nav-menu-group[aria-expanded=true]){z-index:110}
  .sidebar.more-open~.toast,.workspace:has(.sidebar.more-open) .toast,.workspace:has(#nav-menu-group[aria-expanded=true]) .toast{bottom:calc(84px + env(safe-area-inset-bottom));z-index:45}
  .workspace-topbar{grid-template-columns:minmax(0,1fr);gap:8px}
  .workspace-topbar .restaurant-context{grid-column:1;grid-row:1;width:100%;min-width:0}
  .workspace-topbar .restaurant-switch{width:100%;min-width:0}
  .workspace-topbar .account-tools{display:flex;grid-column:1;grid-row:2;justify-content:space-between;max-width:none;width:100%;gap:8px;min-width:0}
  .workspace-topbar #cloud-state{flex:1;min-width:0;max-width:none;font-size:10px}
  .workspace-topbar .workspace-account-actions{display:flex;flex:0 0 auto;align-items:center;gap:8px}
  .workspace-topbar .zimmis-account{grid-column:auto;grid-row:auto}
}
