#cafe-dialog{box-sizing:border-box;width:min(1320px,calc(100vw - 32px));max-width:none;max-height:min(900px,92dvh);padding:0;border:1px solid #ded6c5;border-radius:24px;background:#fffdf7;color:#3f493b;box-shadow:0 20px 65px #2f322755;overflow:hidden;font:15px/1.5 system-ui,-apple-system,sans-serif}#cafe-dialog *{box-sizing:border-box}#cafe-dialog::backdrop{background:#26302996;backdrop-filter:blur(3px)}#cafe-dialog button,#cafe-story-dialog button{min-height:42px;border:1px solid #d9d2c2;border-radius:10px;background:#fffdf7;color:#3f493b;font:600 13px system-ui;padding:8px 12px;cursor:pointer}#cafe-dialog button:hover:not(:disabled),#cafe-story-dialog button:hover:not(:disabled){background:#eee9db}#cafe-dialog button:disabled{opacity:.45;cursor:default}#cafe-dialog button:focus-visible,#cafe-dialog input:focus-visible,#cafe-dialog select:focus-visible,#cafe-story-dialog button:focus-visible{outline:3px solid #aa8550;outline-offset:2px}#cafe-dialog #cafe-toggle,#cafe-dialog [data-action=primary],#cafe-dialog #cafe-save-menu,#cafe-dialog #cafe-apply-theme,#cafe-story-dialog [data-choice]{background:#4e684b;color:#fff;border-color:#4e684b}#cafe-dialog #cafe-toggle:hover,#cafe-dialog [data-action=primary]:hover,#cafe-dialog #cafe-save-menu:hover,#cafe-dialog #cafe-apply-theme:hover,#cafe-story-dialog [data-choice]:hover{background:#3e583d;color:#fff}
.cafe-header{display:flex;align-items:center;gap:15px;padding:19px 22px;background:#fffdf7;border-bottom:1px solid #e7decd}.cafe-mark{display:grid;place-items:center;width:47px;height:47px;border-radius:13px;background:#efe8d6;font-size:25px}.cafe-heading{flex:1;min-width:0}.cafe-heading small{font-size:10px;letter-spacing:1.5px;color:#7e826d}.cafe-heading h2{font:500 26px Georgia,serif;color:#3f493b;margin:3px 0 0;overflow-wrap:anywhere}#cafe-wallet{font-size:13px;font-weight:700;white-space:nowrap}#cafe-close{font-size:20px!important;width:42px;padding:0!important;background:transparent!important;border:0!important}.cafe-workspace{display:grid;grid-template-columns:minmax(0,1.55fr) minmax(365px,1fr);min-height:0}.cafe-shop{padding:20px;border-right:1px solid #e7decd;min-width:0;background:#faf7ef}.cafe-scene-frame{position:relative;background:#f3eddf;border:1px solid #e4dbc8;border-radius:16px;overflow:hidden}#cafe-open-status{position:absolute;left:14px;top:12px;z-index:1;padding:6px 10px;border-radius:20px;background:#e8ecdb;color:#4b6348;font-size:11px;font-weight:700}#cafe-canvas{display:block;width:100%;height:min(52vh,535px);min-height:300px;touch-action:manipulation}.cafe-scene-footer{display:flex;justify-content:space-between;gap:12px;padding:10px 15px;border-top:1px solid #e0d7c5;font-size:11px;color:#67705e}.cafe-story-banner{display:flex;align-items:center;gap:12px;margin-top:14px;padding:12px 15px;border:1px solid #e1d9c4;border-radius:13px;background:#f0eddf}.cafe-story-banner>span{font-size:25px;color:#a78450}.cafe-story-banner p{flex:1;font-size:12px;margin:0}.cafe-help{font-size:12px;color:#6d7566;line-height:1.6}.cafe-operations{min-width:0;display:flex;flex-direction:column;background:#fffdf7}#cafe-tabs{display:flex;padding:8px 13px 0;border-bottom:1px solid #e9e0d1;position:sticky;top:0;z-index:2;background:#fffdf7}#cafe-tabs button{flex:1;min-width:0;border:0;border-radius:0;background:transparent;font-size:12px;padding:14px 2px}#cafe-tabs button[aria-selected=true]{border-bottom:3px solid #6e895d;color:#3e593d}.cafe-body{padding:20px;overflow:auto;max-height:min(62vh,625px);flex:1}.cafe-body h3{font-size:19px;margin:0 0 10px;color:#3f493b}.cafe-body h3:not(:first-child){font-size:15px;margin-top:24px}.cafe-order{background:#fffefa;border:1px solid #e3dac9;border-radius:15px;padding:15px;margin:12px 0}.cafe-order.ready{border-color:#c5a872}.cafe-order-top{display:flex;align-items:center;gap:10px}.cafe-order-top strong,.cafe-order-dish strong{display:block;font-size:13px}.cafe-order-top small,.cafe-order-dish small{display:block;color:#74796c;font-size:11px}.cafe-order-top>span:last-child{margin-left:auto;color:#777e6c;font-size:10px;white-space:nowrap}.cafe-avatar{display:grid;place-items:center;flex:none;background:#e8dfc7;border-radius:50%;width:40px;height:40px;font-size:21px}.cafe-order-dish{display:flex;gap:11px;align-items:center;padding:15px 0}.cafe-order-dish>span{font-size:27px;width:37px;text-align:center}.cafe-order-dish small{color:#957548}.cafe-order-actions{display:flex;align-items:center;justify-content:space-between;gap:7px}.cafe-order-actions>span{font-size:11px;color:#66775b}.cafe-order-actions button{min-height:36px!important;font-size:11px!important;padding:7px!important}.cafe-progress{display:flex;align-items:center;gap:10px;border-top:1px dashed #e3dccd;margin-top:14px;padding-top:12px;font-size:10px;color:#7b7b6b}.cafe-progress progress{margin-left:auto;width:70px;height:6px;accent-color:#839d76}.cafe-recipe{display:flex;gap:11px;align-items:center;background:#fffefa;border:1px solid #e4dccc;border-radius:11px;padding:10px;margin:9px 0;cursor:pointer}.cafe-recipe:has(input:checked){background:#eaf0e3;border-color:#abc09e}.cafe-recipe input{width:17px;height:17px;accent-color:#607c56}.cafe-recipe>span:nth-of-type(1){font-size:24px;width:35px;text-align:center}.cafe-recipe>span:nth-of-type(2){flex:1}.cafe-recipe strong,.cafe-recipe small{display:block}.cafe-recipe strong{font-size:12px}.cafe-recipe small{font-size:10px;color:#707769}.cafe-recipe b{font-size:11px;color:#94703b}.cafe-inline-actions{display:flex;gap:8px;margin:12px 0}.cafe-inline-actions button{flex:1}.cafe-stock-row{display:flex;align-items:center;gap:7px;padding:9px 0;border-bottom:1px solid #eee8dc}.cafe-stock-row span{flex:1;font-size:12px}.cafe-stock-row button{min-height:34px!important;font-size:10px!important}.cafe-pantry-row{display:flex;justify-content:space-between;padding:5px 0;font-size:12px}#cafe-name{display:block;width:100%;padding:11px;margin:7px 0;border:1px solid #d8d1bf;border-radius:9px;background:#fff}#cafe-themes{display:grid;grid-template-columns:repeat(3,1fr);gap:8px}.cafe-theme{font-size:11px!important;min-height:82px!important}.cafe-theme:before{content:"";display:block;width:29px;height:29px;border-radius:50%;margin:2px auto 6px;background:var(--cafe-theme);border:3px solid #fff;box-shadow:0 0 0 1px #d8d0bc}.cafe-theme[aria-pressed=true]{border-color:#719269!important;background:#ebf0e7!important}.cafe-display-row{display:flex;align-items:center;gap:10px;margin:8px 0;font-size:12px}.cafe-display-row select{flex:1;min-width:0;padding:9px;border-radius:8px;border:1px solid #d8d0c1;background:#fff}#cafe-treasures{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:10px}.cafe-treasure{border:1px solid #e5dccd;background:#fffaf1;border-radius:11px;padding:11px;text-align:center;display:flex;flex-direction:column;gap:5px}.cafe-treasure.locked img{filter:grayscale(1);opacity:.45}.cafe-treasure img{object-fit:contain;align-self:center}.cafe-treasure strong{font-size:12px}.cafe-treasure small,.cafe-treasure span{font-size:10px;color:#77796e}.cafe-treasure button{margin-top:auto;font-size:10px!important;min-height:34px!important}.cafe-regular{padding:12px;border:1px solid #e4dac8;border-radius:12px;margin:9px 0;background:#fffefa}.cafe-regular h4{margin:0 0 5px}.cafe-regular p{font-size:11px;line-height:1.6;margin:5px 0}.cafe-regular button{min-height:34px!important;font-size:11px!important}#cafe-status{min-height:38px;padding:9px 20px;border-top:1px solid #e7dfce;background:#f4f3e8;color:#586e52;font-size:11px}
#cafe-story-dialog{border:1px solid #dbcba9;border-radius:18px;background:#fffaf0;color:#3f493b;width:min(480px,calc(100vw - 24px));padding:25px;box-shadow:0 20px 70px #3338}#cafe-story-dialog::backdrop{background:#25302977}#cafe-story-dialog h2{font-size:22px;margin:7px 0}#cafe-story-dialog p{line-height:1.8}#cafe-story-choices button{display:block;width:100%;margin:7px 0}#cafe-story-close{float:right;border:0!important;font-size:20px!important}#cafe-story-done{width:100%}
@media(max-width:850px){#cafe-dialog{width:calc(100vw - 20px);max-height:96dvh;overflow:auto}.cafe-workspace{display:block}.cafe-shop{border-right:0;border-bottom:1px solid #e7decd;padding:14px}#cafe-canvas{height:330px;min-height:0}.cafe-body{max-height:none}#cafe-tabs{position:sticky;top:0}}
@media(max-width:500px){#cafe-dialog{width:100vw;height:100dvh;max-height:100dvh;border-radius:0;border:0}.cafe-header{gap:9px;flex-wrap:wrap;padding:12px}.cafe-mark{width:39px;height:39px;font-size:21px}.cafe-heading h2{font-size:21px}#cafe-wallet{margin-left:48px}#cafe-toggle{margin-left:auto;min-height:36px!important}#cafe-close{position:absolute;right:7px;top:3px}#cafe-canvas{height:245px}.cafe-shop{padding:10px}.cafe-scene-footer{font-size:10px;padding:8px}#cafe-story-banner{padding:10px}#cafe-tabs button{font-size:11px}.cafe-body{padding:14px}#cafe-treasures{gap:7px}.cafe-treasure{padding:8px}.cafe-order{padding:12px}#cafe-wallet{font-size:11px}}
@media(prefers-reduced-motion:reduce){#cafe-dialog *,#cafe-story-dialog *{animation:none!important;transition:none!important}}
#cafe-dialog .cafe-header{position:static;inset:auto;right:auto;left:auto;top:auto;pointer-events:auto;justify-content:flex-start}
#cafe-dialog [hidden],#cafe-story-dialog [hidden]{display:none!important}
@media(max-width:500px){#cafe-dialog .cafe-header{display:grid;grid-template-columns:40px minmax(0,1fr) auto;grid-template-rows:auto auto;gap:7px 9px}#cafe-dialog .cafe-mark{grid-column:1;grid-row:1;align-self:center}#cafe-dialog .cafe-heading{grid-column:2;grid-row:1}#cafe-dialog #cafe-close{grid-column:3;grid-row:1;position:static;justify-self:end}#cafe-dialog #cafe-wallet{grid-column:2;grid-row:2;margin:0;align-self:center}#cafe-dialog #cafe-toggle{grid-column:3;grid-row:2;margin:0;justify-self:end}}
/* A café is a destination of its own: give the room and the workbench the whole screen. */
#cafe-dialog{width:100vw;height:100dvh;max-width:none;max-height:none;margin:0;border:0;border-radius:0;display:none;flex-direction:column}
#cafe-dialog[open]{display:flex}
#cafe-dialog .cafe-header{flex:none}
#cafe-dialog .cafe-workspace{flex:1;min-height:0;grid-template-columns:minmax(0,1.55fr) minmax(390px,1fr)}
#cafe-dialog .cafe-shop{overflow:auto}
#cafe-dialog #cafe-canvas{height:clamp(390px,68vh,900px);min-height:390px}
#cafe-dialog .cafe-body{max-height:none}
/* Let the desktop workbench shrink to the viewport so its body can scroll. */
@media(min-width:851px){
    #cafe-dialog .cafe-workspace{grid-template-rows:minmax(0,1fr)}
    #cafe-dialog .cafe-operations{min-height:0;overflow:hidden}
    #cafe-dialog #cafe-tabs{flex:none}
    #cafe-dialog .cafe-body{min-height:0;overflow-y:auto}
}
#cafe-dialog #cafe-status{flex:none}
#cafe-dialog .cafe-stock-row input{width:72px;min-width:52px;min-height:38px;padding:5px;border:1px solid #d8d0c1;border-radius:8px;background:#fff;text-align:center;font:600 13px system-ui}
#cafe-dialog .cafe-stock-row input:disabled{opacity:.55}
#cafe-dialog .cafe-staff-card{display:grid;grid-template-columns:64px 1fr;gap:4px 12px;align-items:center;padding:14px;margin:10px 0;border:1px solid #e4dac8;border-radius:14px;background:#fffefa}
#cafe-dialog .cafe-staff-avatar{grid-row:span 3;display:grid;place-items:center;width:58px;height:58px;border-radius:50%;background:#f0ead9;font-size:30px}
#cafe-dialog .cafe-staff-card h4,#cafe-dialog .cafe-staff-card p{margin:0}
#cafe-dialog .cafe-staff-card p{font-size:12px;color:#697363}
#cafe-dialog .cafe-staff-card button{grid-column:2;justify-self:start}
@media(max-width:850px){#cafe-dialog{overflow:auto}#cafe-dialog .cafe-workspace{display:block;overflow:auto}#cafe-dialog .cafe-shop{border:0;border-bottom:1px solid #e7decd}#cafe-dialog #cafe-canvas{height:clamp(280px,48vh,520px);min-height:280px}#cafe-dialog .cafe-body{max-height:none}}
@media(max-width:500px){#cafe-dialog .cafe-workspace{display:block}#cafe-dialog #cafe-canvas{height:36vh;min-height:220px}#cafe-dialog .cafe-header{flex:none}#cafe-dialog #cafe-tabs{position:sticky;top:0}}

#cafe-dialog .cafe-order.short-supplies{border:2px solid #b65b16;background:#fff7e8}
#cafe-dialog .short-supplies [data-field=shortage]{padding:12px;border-radius:9px;background:#ffe2ac;color:#743309;font-size:14px;font-weight:700;line-height:1.6}
#cafe-dialog .short-supplies [data-field=state]{color:#743309;font-weight:700}

#cafe-dialog .cafe-order-ingredients{padding:10px 12px;margin-bottom:12px;border-radius:9px;background:#f4f3e8;font-size:12px}
#cafe-dialog .cafe-order-ingredients p{margin:7px 0;overflow-wrap:anywhere}
#cafe-dialog .cafe-order-ingredients small{display:block;color:#66705e;font-size:11px}
#cafe-dialog .cafe-ingredient-missing{color:#743309;font-weight:700}
#cafe-dialog .cafe-order-ingredients button{font-size:11px;min-height:34px}

.cafe-window-controls{display:flex;align-items:center;gap:6px;flex:none}
#cafe-dialog #cafe-close{position:static}
#cafe-minimized{position:fixed;top:calc(92px + env(safe-area-inset-top,0px));left:50%;transform:translateX(-50%);z-index:18;display:flex;align-items:center;flex-wrap:wrap;width:min(440px,calc(100vw - 24px));padding:5px;border:1px solid #d9d2c2;border-radius:14px;background:#fffdf7;color:#3f493b;box-shadow:0 5px 24px #2f322733;font:13px/1.5 system-ui,-apple-system,sans-serif}
#cafe-minimized[hidden],#cafe-minimized [hidden]{display:none!important}
#cafe-minimized button{min-height:44px;border:0;border-radius:10px;background:transparent;color:inherit;font:600 13px system-ui;cursor:pointer}
#cafe-minimized button:hover{background:#eee9db}
#cafe-minimized button:focus-visible{outline:3px solid #aa8550;outline-offset:1px}
#cafe-restore{display:flex;align-items:center;gap:10px;flex:1;min-width:0;padding:6px 10px;text-align:left}
#cafe-restore>span:first-child{font-size:23px}
.cafe-minimized-details{display:flex;flex:1;flex-direction:column;min-width:0}
.cafe-minimized-details strong{overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.cafe-minimized-details small{font-size:11px;font-weight:400;overflow-wrap:anywhere}
#cafe-restore-label{flex:none;color:#4e684b}
#cafe-minimized-close{flex:none;width:40px;font-size:22px!important}
#cafe-minimized-notice{width:100%;margin:2px 10px 5px;font-size:11px;overflow-wrap:anywhere}
@media(max-width:500px){#cafe-dialog .cafe-window-controls{grid-column:3;grid-row:1}#cafe-dialog #cafe-minimize{padding:7px;font-size:12px}#cafe-dialog .cafe-heading h2{font-size:18px}#cafe-dialog #cafe-close{width:32px}#cafe-dialog .cafe-heading small{letter-spacing:.5px}}

/* Scene-first café: tools open a compact drawer over the room. */
#cafe-dialog{background:#dbe2cd;overflow:hidden}
#cafe-dialog .cafe-header{padding:10px 20px;gap:12px;background:#fffdf5f5;border-bottom:1px solid #d9d5bf}
#cafe-dialog .cafe-heading h2{font-size:23px;margin:0}
#cafe-dialog .cafe-heading small{font-size:9px}
#cafe-dialog .cafe-mark{width:40px;height:40px}
#cafe-dialog .cafe-workspace{position:relative;display:block;overflow:hidden}
#cafe-dialog .cafe-shop{position:absolute;inset:0;padding:0;overflow:hidden;border:0;background:transparent}
#cafe-dialog .cafe-scene-frame{width:100%;height:100%;border:0;border-radius:0;background:transparent}
#cafe-dialog #cafe-canvas{height:100%;width:100%;min-height:0}
#cafe-dialog #cafe-open-status{top:16px;left:20px;background:#fffdf0e8;box-shadow:0 3px 14px #57604412}
#cafe-dialog .cafe-scene-footer{position:absolute;bottom:94px;left:20px;padding:7px 12px;gap:16px;border:1px solid #d5d3bc;border-radius:20px;background:#fffdf0e8}
#cafe-dialog #cafe-away-note{position:absolute;top:50px;left:20px;max-width:330px;font-size:11px;margin:6px 0;background:#fffdf0d9;padding:5px 9px;border-radius:8px;pointer-events:none}
#cafe-dialog #cafe-story-banner{position:absolute;left:20px;bottom:138px;width:min(330px,calc(100% - 40px));margin:0;background:#fffbedef;box-shadow:0 6px 20px #374d3220}
#cafe-dialog #cafe-tabs{position:absolute;top:auto;left:50%;bottom:14px;transform:translateX(-50%);display:flex;gap:5px;padding:7px;background:#fffdf3f5;border:1px solid #d0ceba;border-radius:18px;box-shadow:0 8px 30px #3d4f3528;z-index:4;max-width:calc(100% - 24px);overflow-x:auto}
#cafe-dialog #cafe-tabs button{position:relative;flex:none;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;width:62px;min-height:57px;border:1px solid transparent;border-radius:12px;padding:5px;color:#5d6d52}
#cafe-dialog #cafe-tabs button[aria-selected=true]{background:#e1e9d6;border-color:#adb99b;color:#314c36}
#cafe-dialog #cafe-tabs button:hover{background:#eee9db}
#cafe-dialog .cafe-tool-icon{font-size:23px;line-height:1.1}
#cafe-dialog #cafe-tabs small{font-size:10px;white-space:nowrap}
#cafe-dialog .cafe-count{position:absolute;top:0;right:3px;background:#9e603f;color:white;border-radius:12px;min-width:18px;padding:1px 4px;font-size:10px}
#cafe-dialog .cafe-operations{position:absolute;right:18px;top:16px;bottom:94px;width:365px;max-width:calc(100% - 36px);min-height:0;z-index:3;overflow:hidden;border:1px solid #d5cfb9;border-radius:18px;background:#fffcf3f5;box-shadow:0 16px 44px #33462c30}
#cafe-dialog .cafe-panel-head{display:flex;justify-content:space-between;align-items:center;padding:10px 16px;border-bottom:1px solid #e2dccb;flex:none;background:#f6f1e4}
#cafe-dialog #cafe-panel-close{border:0;background:transparent;font-size:23px;min-height:36px;width:36px;padding:0}
#cafe-dialog .cafe-body{padding:16px;overflow-y:auto;min-height:0;max-height:none;overscroll-behavior:contain}
#cafe-dialog #cafe-status{min-height:0;padding:0 16px;background:#fffdf5;font-size:12px}
#cafe-dialog #cafe-status:not(:empty){padding:7px 16px;min-height:32px}
#cafe-dialog .cafe-zoom{position:absolute;left:20px;bottom:14px;display:flex;gap:5px;z-index:2}
#cafe-dialog .cafe-zoom button{width:40px;padding:0;font-size:20px;background:#fffdf3}
#cafe-dialog .cafe-furniture-catalog{display:grid;grid-template-columns:1fr 1fr;gap:8px}
#cafe-dialog .cafe-furniture-catalog button{text-align:left;font-size:12px;line-height:1.5;padding:12px}
#cafe-dialog #cafe-furniture-select{display:block;width:100%;padding:11px;border:1px solid #d5cdb9;border-radius:10px;background:#fff;margin:10px 0;color:inherit}
#cafe-dialog .cafe-layout-controls{display:flex;gap:5px;margin:12px 0;flex-wrap:wrap}
#cafe-dialog .cafe-layout-controls button{flex:1;padding:6px;min-width:42px}
#cafe-dialog [data-cafe-action=save-layout],#cafe-dialog [data-cafe-action=expand]{background:#4e684b;color:white}
@media(max-width:700px){
    #cafe-minimized{top:calc(148px + env(safe-area-inset-top,0px))}
    #cafe-dialog .cafe-header{display:flex;flex-wrap:wrap;padding:9px 12px;gap:7px}
    #cafe-dialog .cafe-heading{flex:1}
    #cafe-dialog .cafe-heading h2{font-size:18px}
    #cafe-dialog .cafe-heading small{display:none}
    #cafe-dialog #cafe-wallet{margin:0;font-size:11px}
    #cafe-dialog #cafe-toggle{order:4;margin:0;min-height:34px;padding:6px 9px;font-size:11px}
    #cafe-dialog .cafe-window-controls{margin-left:auto}
    #cafe-dialog #cafe-minimize,#cafe-dialog #cafe-close{width:34px;padding:0;min-height:36px}
    #cafe-dialog .cafe-operations{top:auto;bottom:89px;left:10px;right:10px;width:auto;max-width:none;max-height:48%;border-radius:16px}
    #cafe-dialog .cafe-body{max-height:calc(48dvh - 60px)}
    #cafe-dialog.cafe-panel-open .cafe-scene-frame{height:52%}
    #cafe-dialog.cafe-panel-open #cafe-away-note,#cafe-dialog.cafe-panel-open .cafe-scene-footer{display:none}
    #cafe-dialog #cafe-tabs{gap:1px;padding:5px;bottom:10px;max-width:calc(100% - 14px);border-radius:14px}
    #cafe-dialog #cafe-tabs button{width:46px;min-height:54px;padding:4px 1px}
    #cafe-dialog #cafe-tabs small{font-size:8px}
    #cafe-dialog .cafe-tool-icon{font-size:21px}
    #cafe-dialog .cafe-zoom{left:auto;right:10px;top:15px;bottom:auto;flex-direction:column}
    #cafe-dialog .cafe-zoom button{width:34px;min-height:34px}
    #cafe-dialog #cafe-open-status,#cafe-dialog #cafe-away-note{left:12px;max-width:260px}
    #cafe-dialog #cafe-away-note{font-size:10px}
    #cafe-dialog .cafe-scene-footer{left:12px;bottom:89px;font-size:10px}
    #cafe-dialog #cafe-story-banner{left:12px;bottom:130px}
}
