/* 1108-13 home: 4×6 grid of widgets and 1×1 function icons, iOS-like; same raised treatment on widgets
   as on the 3D icons. Phone and desktop share one layout (centred, width-limited). */
.h13-root{--gap:14px;max-width:440px;margin:0 auto;padding:10px 14px 6px;box-sizing:border-box;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.h13-loading{text-align:center;color:var(--muted);padding:40px 0}
.h13-editbar{display:flex;justify-content:space-between;align-items:center;margin:0 0 8px}
.h13-editbar button{min-height:34px;border-radius:999px;padding:0 16px;font-weight:600}
.h13-editbar [data-add]{width:34px;padding:0;font-size:22px;line-height:1;background:#fff;border:1px solid #e3dfd6}
.h13-pages{display:flex;overflow-x:auto;overflow-y:hidden;scroll-snap-type:x mandatory;scrollbar-width:none;container-type:inline-size}
.h13-pages::-webkit-scrollbar{display:none}
.h13-grid{--col:calc((100cqw - 3 * var(--gap)) / 4);--ic:calc(var(--col) * .74);flex:0 0 100%;scroll-snap-align:start;display:grid;grid-template-columns:repeat(4,minmax(0,1fr));grid-template-rows:repeat(6,calc(var(--col) * 1.12));column-gap:var(--gap);row-gap:4px;padding-top:6px}
.h13-item{position:relative;display:flex;flex-direction:column;align-items:center;gap:4px;min-width:0;touch-action:pan-x pan-y}
.h13-root.editing .h13-item{touch-action:none}
.h13-box{position:relative;width:100%;flex:1;min-height:0;box-sizing:border-box;border-radius:20px;overflow:hidden;color:var(--ink);
 background:linear-gradient(180deg,#ffffff,#f3f1ec);border:1px solid #e3dfd6;box-shadow:0 2px 4px rgba(0,0,0,.14),inset 0 1px 0 #fff,inset 0 -2px 0 rgba(0,0,0,.05)}
.h13-box.dark{background:linear-gradient(180deg,#3a3a3c,#1f1f21);border-color:#1f1f21;box-shadow:0 2px 4px rgba(0,0,0,.25),inset 0 1px 0 rgba(255,255,255,.12)}
.size-small .h13-box{flex:none;width:var(--ic);height:var(--ic);border-radius:calc(var(--ic) * .24)}
.h13-box.is-app{background:none;border:0;box-shadow:none;overflow:visible}
.h13-app{display:block;width:100%;height:100%;-webkit-user-drag:none}
.h13-app svg,.h13-box>.biz-one svg{display:block;width:100%;height:100%}
.h13-app svg{filter:drop-shadow(0 2px 3px rgba(0,0,0,.22))}
.h13-label{max-width:100%;font-size:12px;line-height:1.4;padding-bottom:1px;color:var(--ink);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.h13-minus{position:absolute;z-index:3;top:-6px;left:-6px;width:22px;height:22px;min-height:0;padding:0;border-radius:50%;border:0;background:#8e8e93;color:#fff;font-size:18px;line-height:20px;box-shadow:0 1px 2px rgba(0,0,0,.25)}
.size-small .h13-minus{left:calc(50% - var(--ic) / 2 - 7px)}
.h13-root.editing .h13-box{animation:h13-wiggle .28s ease-in-out infinite alternate}
.h13-item:nth-child(even) .h13-box{animation-delay:.14s}
@keyframes h13-wiggle{from{transform:rotate(-1deg)}to{transform:rotate(1deg)}}
@media(prefers-reduced-motion:reduce){.h13-root.editing .h13-box{animation:none}}
.h13-item.dragging{z-index:20;opacity:.92}
.h13-item.dragging .h13-box{animation:none;box-shadow:0 10px 24px rgba(0,0,0,.22)}
.h13-item.drop-target .h13-box{outline:2px dashed #8e8e93;outline-offset:3px}
.h13-dots{display:flex;justify-content:center;gap:2px;margin:8px auto 0;width:max-content;padding:4px 8px;border-radius:999px;background:rgba(0,0,0,.05)}
.h13-dots button{width:14px;height:14px;min-height:0;padding:0;border:0;background:none;display:grid;place-items:center}
.h13-dots button:after{content:'';width:6px;height:6px;border-radius:50%;background:#cfcdc6}
.h13-dots [aria-current]:after{background:#2f5744}
.h13-box .widget-empty{display:grid;place-items:center;height:100%;font-size:11px;color:var(--muted);text-align:center}
.h13-fill{display:flex;width:100%;height:100%;align-items:center;justify-content:center;color:inherit;text-decoration:none}
/* 待办与通知 */
.td-one{position:relative;display:grid;place-items:center;width:100%;height:100%}
.td-one b{font-size:24px;color:#E5484D;font-variant-numeric:tabular-nums}.td-one b.zero,.td-head b.zero{color:#b7b4ab}
.td-dot{position:absolute;top:4px;right:4px;min-width:16px;height:16px;padding:0 4px;box-sizing:border-box;border-radius:8px;background:#E5484D;color:#fff;font-size:10px;font-style:normal;line-height:16px;text-align:center}
.td-box{display:flex;flex-direction:column;gap:3px;height:100%;padding:8px 10px;box-sizing:border-box;cursor:pointer}
.td-head{display:flex;align-items:baseline;gap:6px}.td-head b{font-size:22px;line-height:1.1;color:#E5484D;font-variant-numeric:tabular-nums}.td-head span{font-size:11px;color:var(--muted)}
.td-list{display:flex;flex-direction:column;min-height:0}.td-list.two{display:grid;grid-template-columns:1fr 1fr;column-gap:10px}
.td-row{display:flex;align-items:center;gap:4px;min-width:0;min-height:0;padding:4px 0;border:0;border-top:1px solid #eeece6;border-radius:0;background:none;box-shadow:none;font-size:12px;color:inherit;text-align:left}
.td-row b{font-variant-numeric:tabular-nums}
.td-tag,.biz-tag{display:inline-block;flex:none;padding:0 6px;border-radius:6px;background:var(--c);color:#fff;font-size:10px;font-weight:700;line-height:16px;white-space:nowrap}
.td-where{margin-left:auto;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:11px;color:var(--muted)}
.td-notice{display:flex;align-items:center;gap:5px;margin:auto 0 0;font-size:11px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.td-notice i{flex:none;width:6px;height:6px;border-radius:50%;background:#E5484D}
/* 我的班次 */
.sh-one{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:1px;line-height:1}
.sh-one small{font-size:9px;font-weight:700;color:#E5484D}.sh-one b{font-size:20px}
.sh-one span{display:flex;align-items:center;gap:2px;font-size:9px;color:var(--muted)}.sh-one i{font-style:normal;font-weight:700;border-radius:4px;padding:0 3px}
/* 今日当班：布局不变，白底细边、岗位颜色小标签、黑色名字 */
.du-one{display:flex;flex-direction:column;align-items:center;justify-content:center;width:100%;height:100%;min-height:0;padding:0;border:0;background:none;box-shadow:none;line-height:1.1}
.du-one small{font-size:9px;color:var(--muted)}.du-one b{font-size:20px}
.du-box{display:flex;flex-direction:column;gap:5px;height:100%;padding:8px 9px;box-sizing:border-box}
.du-head{display:flex;align-items:center;gap:5px}.du-head button{min-height:22px;padding:0 9px;border-radius:999px;font-size:11px;background:#fff;border:1px solid #e3dfd6;box-shadow:none}
.du-head span{margin-left:auto;font-size:11px;color:var(--muted)}.du-head b{font-size:15px;color:var(--ink);margin-right:2px}
.du-staff{display:grid;gap:4px;min-height:0;overflow:hidden;align-content:start}.du-staff.two{grid-template-columns:repeat(2,minmax(0,1fr))}.du-staff.three{grid-template-columns:repeat(3,minmax(0,1fr))}
.du-staff>button,.du-chip{display:flex;flex-direction:column;align-items:flex-start;gap:2px;min-width:0;min-height:0;padding:4px 6px;border-radius:8px;background:#fff;border:1px solid #e6e3dc;box-shadow:none;text-align:left}
.du-staff small{max-width:100%;padding:0 5px;border-radius:5px;font-size:9px;line-height:14px;color:#2d2d2b;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.du-staff b{max-width:100%;font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis;color:#1d1d1f}
.du-more{min-height:0;padding:2px;border:0;background:none;box-shadow:none;font-size:11px;color:var(--muted)}
/* 经营情况 */
.biz-one{display:block;width:100%;height:100%;min-height:0;padding:0;border:0;background:none;box-shadow:none}
.biz-m{display:flex;flex-direction:column;align-items:center;justify-content:center;gap:6px;height:100%;padding:8px;box-sizing:border-box}
.biz-m .biz-rings{width:min(100%,58%);height:auto;flex:1;min-height:0}
.biz-m-list{display:grid;grid-template-columns:repeat(3,1fr);width:100%;text-align:center}
.biz-m-list div{display:flex;flex-direction:column;line-height:1.15}.biz-name{font-size:10px;font-weight:700}.biz-m-list b{font-size:12px;letter-spacing:-.02em;font-variant-numeric:tabular-nums}
.biz-l{display:flex;align-items:center;gap:12px;height:100%;padding:8px 12px;box-sizing:border-box}
.biz-l .biz-rings{height:100%;width:auto;aspect-ratio:1;flex:none}
.biz-l-rows{flex:1;min-width:0;display:flex;flex-direction:column;gap:4px}
.biz-l-head{display:flex;align-items:center;gap:6px;white-space:nowrap}.biz-l-head b{font-size:13px;font-variant-numeric:tabular-nums}.biz-mean{font-size:11px;color:var(--muted)}
.biz-bars{display:block;width:100%;height:20px}
/* VM 与 OpenAI */
.vm-ring,.ai-radial{display:block;width:100%;height:100%;min-height:0;padding:0;border:0;background:none;box-shadow:none}
.vm-ring svg,.ai-radial svg{display:block;width:100%;height:100%}
/* 设置与添加：底部弹出 */
dialog.h13-sheet{position:fixed;inset:auto 0 0 0;margin:0 auto;width:100%;max-width:520px;max-height:82vh;padding:0;border:0;border-radius:18px 18px 0 0;background:var(--paper,#f3f1ec);box-shadow:0 -6px 30px rgba(0,0,0,.18);overflow:auto}
dialog.h13-sheet::backdrop{background:rgba(0,0,0,.28)}
.h13-sheet-head{position:sticky;top:0;z-index:1;display:flex;align-items:center;justify-content:space-between;padding:14px 16px 10px;background:inherit}
.h13-sheet-head h2{margin:0;font-size:17px}
.h13-sheet-head button{min-height:32px;border-radius:999px;padding:0 16px}
.h13-sheet-body{display:flex;flex-direction:column;gap:14px;padding:0 16px 22px}
.h13-sheet-body section h3{margin:0 0 6px;font-size:13px;font-weight:600;color:var(--muted)}
.h13-seg{display:flex;padding:2px;border-radius:10px;background:#e7e5df}
.h13-seg button{flex:1;min-height:30px;border:0;border-radius:8px;background:none;box-shadow:none;font-weight:600}
.h13-seg [aria-pressed=true]{background:#fff;box-shadow:0 1px 2px rgba(0,0,0,.12)}
.h13-chips{display:flex;flex-wrap:wrap;gap:8px}
.h13-chips button{min-height:30px;padding:0 14px;border-radius:999px;border:1.5px solid var(--c);background:#fff;color:var(--c);font-weight:700;box-shadow:none}
.h13-chips [aria-pressed=true]{background:var(--c);color:#fff}
.h13-remove{min-height:44px;border-radius:12px;background:#fff;border:1px solid #e6e3dc;color:#E5484D;font-weight:600;box-shadow:none}
.h13-search input{width:100%;box-sizing:border-box;min-height:36px;border-radius:10px;border:1px solid #e3dfd6;padding:0 12px;background:#fff}
.h13-add-list{display:flex;flex-direction:column;border-radius:12px;overflow:hidden;background:#fff;border:1px solid #e6e3dc}
.h13-add-row{display:flex;align-items:center;gap:10px;min-height:46px;padding:6px 12px;border:0;border-top:1px solid #eeece6;border-radius:0;background:none;box-shadow:none;text-align:left;color:var(--ink)}
.h13-add-list .h13-add-row:first-child{border-top:0}
.h13-add-row small{margin-left:auto;font-size:11px;color:var(--muted)}
.h13-add-row i{margin-left:auto;font-style:normal;color:#34C759;font-weight:700}
.h13-add-row:disabled{opacity:.55}
.h13-add-icon{width:32px;height:32px;flex:none}
/* 1108-13 我的通知与待办 page: grouped-list style of the 其他 page */
.todo-page{max-width:640px;margin:0 auto;padding:8px 16px 24px}
.todo-page h1{font-size:22px;margin:6px 0 12px}
.tp-chips{display:flex;gap:8px;overflow-x:auto;scrollbar-width:none;margin:0 -16px 14px;padding:0 16px}
.tp-chips::-webkit-scrollbar{display:none}
.tp-chip{flex:none;min-height:30px;padding:0 12px;border-radius:999px;background:#fff;border:1px solid #e3dfd6;box-shadow:none;font-size:13px;white-space:nowrap}
.tp-chip b{margin-left:2px;color:var(--muted);font-weight:600}
.tp-chip[aria-pressed=true]{background:#2f5744;border-color:#2f5744;color:#fff}.tp-chip[aria-pressed=true] b{color:#fff}
.tp-sec{margin:0 0 16px}
.tp-sec header{display:flex;align-items:center;justify-content:space-between;margin:0 0 6px}
.tp-sec h2{display:flex;align-items:center;gap:6px;margin:0;font-size:13px;font-weight:600;color:var(--muted)}
.tp-sec h2 b{color:var(--ink)}.tp-sec h2 a{color:var(--ink);text-decoration:none}
.tp-sec header button{min-height:0;padding:2px 4px;border:0;background:none;box-shadow:none;font-size:13px;color:#0A84FF}
.tp-dot{width:7px;height:7px;border-radius:50%;background:#E5484D}
.tp-tag{padding:0 7px;border-radius:6px;background:#8e8e93;color:#fff;font-size:11px;font-weight:700;line-height:18px}
.tp-group{border-radius:14px;background:#fff;border:1px solid #e6e3dc;overflow:hidden}
.tp-row{display:flex;align-items:center;gap:8px;min-height:44px;padding:8px 14px;border-top:1px solid #eeece6;color:var(--ink);text-decoration:none}
.tp-group .tp-row:first-child{border-top:0}
.tp-main{flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;font-size:14px}
.tp-row small{flex:none;font-size:11px;color:var(--muted)}.tp-row b{flex:none;font-variant-numeric:tabular-nums}.tp-row i{flex:none;font-style:normal;color:#c4c1b8}
.tp-empty{color:var(--muted);text-align:center;padding:30px 0}
/* The shared dialog enhancer makes #modal full-screen; the home sheets stay bottom sheets. */
#modal[open].h13-sheet,#modal[open].unified-dialog.h13-sheet{position:fixed;top:auto;bottom:0;left:0;right:0;margin:0 auto;width:100%;max-width:520px;height:auto;max-height:82vh;padding:0;border:0;border-radius:18px 18px 0 0;overflow:auto}
#modal.h13-sheet .h13-sheet-head.dialog-heading{position:sticky;top:0;margin:0;padding:14px 16px 10px;background:var(--paper,#f3f1ec)}
#modal.h13-sheet .h13-sheet-head h2{font-size:17px}
#modal.h13-sheet .h13-remove{background:#fff;border:1px solid #e6e3dc;color:#E5484D}
/* 1108-13: 其他 page rows show the same 3D function icons as the home page. */
.os-ic.os-ic3d{width:30px;height:30px;background:none;border-radius:0}
.os-ic.os-ic3d svg{width:30px;height:30px;stroke-width:initial;filter:drop-shadow(0 1px 1.5px rgba(0,0,0,.2))}
/* 1108-15 (user feedback on the live home, 2026-11-08): too much empty space, uneven spacing, clipped labels.
   - The six rows fill the height between the top of the page and the page dots / bottom navigation
     (never shorter than the icon-based minimum), like an iPhone home screen.
   - Less padding above the first row.
   - Widgets line up with the icon grid: a widget starts at the left edge of its first column's icon and ends
     at the right edge of its last column's icon; its top is the icon top and its bottom is the bottom of the
     icon in its last row (the label sits below, like an icon's).
   - Labels may use the full column plus the gap before they are shortened. */
.widget-shell .content:has(.h13-root){padding-top:4px}
.h13-root{--avail:calc(100dvh - 4px - 64px - env(safe-area-inset-top) - env(safe-area-inset-bottom) - 34px);padding-top:0}
.h13-grid{--rowgap:4px;--rowh:max(calc(var(--col) * 1.1),calc((var(--avail) - 5 * var(--rowgap)) / 6));grid-template-rows:repeat(6,var(--rowh));row-gap:var(--rowgap);padding-top:4px}
.h13-item:not(.size-small) .h13-box{flex:none;align-self:center;width:calc(100% - (var(--col) - var(--ic)));height:calc(100% - (var(--rowh) - var(--ic)))}
.h13-label{max-width:calc(100% + var(--gap) - 2px);font-size:12px;letter-spacing:-.01em}
.h13-root{--gap:12px;padding-left:4px;padding-right:4px}
.h13-grid{--ic:calc(var(--col) * .78);--rowh:min(calc(var(--col) * 1.45),max(calc(var(--col) * 1.1),calc((var(--avail) - 5 * var(--rowgap)) / 6)))}
.h13-grid .h13-label{font-size:clamp(10.5px,calc(var(--col) * .14),12px)}
/* 1108-15 rev 2 (user: “照着来”, iPhone home screen reference measured at 430pt wide): 4 contiguous columns
   of 98 (icon 65 centred, i.e. 66% of the column), row pitch 106 (1.08 × column), grid inset 19 from each
   screen edge, rows not stretched to fill the height. A 2×2 widget runs from the first row's icon top to the
   second row's icon bottom and from the left icon's left edge to the right icon's right edge. */
.h13-root{--gap:0px;padding-left:3px;padding-right:3px}
.h13-grid{--col:calc(100cqw / 4);--ic:calc(var(--col) * .663);--rowgap:0px;--rowh:calc(var(--col) * 1.08);grid-template-rows:repeat(6,var(--rowh));column-gap:0;row-gap:0;padding-top:18px}
.h13-item{gap:5px}
.h13-grid .h13-label{max-width:calc(100% - 4px);font-size:12px}
/* The “−” sits on the top-left corner of the icon or widget itself, inside the column, so the screen edge
   never cuts it off. */
.h13-grid .h13-minus,.h13-grid .size-small .h13-minus{top:-8px;left:calc((var(--col) - var(--ic)) / 2 - 9px)}
.h13-grid{--rowh:min(calc(var(--col) * 1.08),calc((var(--avail) - 18px) / 6))}
.h13-grid .h13-label{font-size:clamp(10.5px,calc(var(--col) * .125),12px)}
.h13-item.dragging{z-index:30;opacity:.95;pointer-events:none}
.h13-item.dragging .h13-box{transform:scale(1.08);box-shadow:0 12px 26px rgba(0,0,0,.25)}
.h13-root.editing,.h13-root.editing *{-webkit-user-select:none;user-select:none;-webkit-touch-callout:none}
.h13-root.editing,.h13-root.editing .h13-pages,.h13-root.editing .h13-item{touch-action:none;overscroll-behavior:none}
html:has(.h13-root.editing),body:has(.h13-root.editing){overscroll-behavior:none}
/* 1108-15: 今日当班 rows share the widget height; with more than three rows each person is one line
   (post tag and name side by side) so a busy dinner shift (13+ people) fits without clipping. */
.du-staff{flex:1;grid-template-rows:repeat(var(--rows,3),minmax(0,1fr))}
.du-staff>button{justify-content:center;overflow:hidden}
.du-staff.compact{gap:3px}
.du-staff.compact>button{flex-direction:row;align-items:center;gap:4px;padding:1px 5px;border-radius:6px}
.du-staff.compact small{flex:none;max-width:55%;font-size:9px;line-height:13px}
.du-staff.compact b{font-size:11px;min-width:0}
/* 1108-15: one soft drop shadow like the 3D icons (0 2px 3px), plus the top highlight; no darker bottom lip. */
.h13-box{border-color:#e7e4dd;box-shadow:0 2px 3px rgba(0,0,0,.13),inset 0 1px 0 #fff}
.h13-box.dark{box-shadow:0 2px 3px rgba(0,0,0,.22),inset 0 1px 0 rgba(255,255,255,.12)}
.h13-box.is-app{box-shadow:none}
.du-staff.compact>button{justify-content:flex-start}
/* Old home rules for .size-small (padding/background) must not reach the new grid items. */
.h13-item.size-small,.h13-item.size-medium,.h13-item.size-large{padding:0;border-radius:0;background:none}
/* 1108-15 rev 3 (compared with the user's iPhone screenshot): the drawn tile fills the icon cell (the SVG
   has a 4/120 margin, so it is scaled up to hide it) — icons and 1×1 widgets are the same visible size;
   a 2×2 widget is square (iPhone: 4pt wider than the icon pair on each side); labels sit closer. */
.h13-app{overflow:visible}
.h13-app svg{width:107.15%;height:107.15%;margin:-3.57%}
.h13-item:not(.size-small) .h13-box{width:calc(100% - (var(--col) - var(--ic)) + (var(--rowh) - var(--col)))}
.h13-item{gap:4px}
.h13-grid .h13-minus{left:calc((var(--col) - var(--ic)) / 2 - 9px)}
.h13-grid .size-medium .h13-minus,.h13-grid .size-large .h13-minus{left:calc((var(--col) - var(--ic)) / 2 - (var(--rowh) - var(--col)) / 2 - 9px)}
/* 1108-15 rev 4: first row's icon top 92pt from the screen top like the iPhone home screen (status bar /
   safe area + 33); the browser-only install hint is not shown on the home page. */
.h13-grid{padding-top:29px}
body:has(.h13-root) #pwa-install{display:none!important}
.h13-grid{padding-top:13px}
