.team-chat-open{position:relative;display:inline-flex;gap:6px;align-items:center;white-space:nowrap;margin-left:auto!important;padding:10px 12px!important;min-height:42px}.team-chat-open+.quiet{margin-left:0}.team-chat-badge{display:inline-flex;align-items:center;justify-content:center;min-width:20px;height:20px;padding:0 5px;border-radius:12px;background:var(--accent);color:#fff;font-size:11px;font-weight:750}.team-chat{--chat-soft:color-mix(in srgb,var(--accent) 7%,var(--card));max-width:100%;padding-bottom:10px}.team-chat-heading{display:flex;justify-content:space-between;gap:16px;align-items:flex-start;margin:20px 0 16px}.team-chat-heading h1{margin:3px 0 6px;font-size:26px}.team-chat-eyebrow{margin:0;color:var(--accent);font-size:10px;letter-spacing:1.8px;font-weight:750}.team-chat-subtitle{margin:0;color:var(--muted);font-size:13px;line-height:1.4}.team-chat-heading-actions{display:flex;gap:6px;flex-wrap:wrap;justify-content:flex-end}.team-chat-heading-actions .chip{font-size:11px;min-height:36px}.team-chat-status{min-height:18px;font-size:12px;line-height:1.5;color:var(--muted);margin:8px 2px}.team-chat-status[data-error=true]{color:var(--error)}.team-chat-frame{height:min(56dvh,620px);min-height:230px;overflow:auto;overscroll-behavior:contain;border:1px solid var(--line);border-radius:18px 18px 0 0;background:color-mix(in srgb,var(--bg) 72%,var(--card));scrollbar-gutter:stable;padding:14px 10px}.team-chat-messages{display:flex;flex-direction:column;gap:15px;outline:none}.team-chat-empty{display:grid;place-content:center;min-height:190px;padding:28px;color:var(--muted);font-size:14px;text-align:center;line-height:1.6}.team-chat-older{display:block;margin:0 auto 14px;min-height:36px}.team-chat-message{display:flex;gap:8px;align-items:flex-start;max-width:92%}.team-chat-message.is-mine{align-self:flex-end;flex-direction:row-reverse}.team-chat-avatar{display:grid;place-items:center;flex:none;width:29px;height:29px;border-radius:10px;background:color-mix(in srgb,var(--accent) 13%,var(--line));color:var(--accent);font-size:10px;font-weight:750;margin-top:2px}.team-chat-bubble{min-width:0;max-width:100%;padding:10px 12px 7px;border:1px solid var(--line);border-radius:4px 15px 15px;background:var(--card);box-shadow:0 2px 3px #00000004}.is-mine>.team-chat-bubble{border-radius:15px 4px 15px 15px;background:var(--chat-soft);border-color:color-mix(in srgb,var(--accent) 24%,var(--line))}.team-chat-message-meta{display:flex;align-items:baseline;gap:10px;flex-wrap:wrap;line-height:1.3}.team-chat-message-meta strong{font-size:12px;color:var(--accent)}.team-chat-message-meta time{font-size:10px;color:var(--muted);margin-left:auto;white-space:nowrap}.team-chat-pin-mark{font-size:9px;color:var(--muted)}.team-chat-message-text{font-size:14px;line-height:1.55;white-space:pre-wrap;overflow-wrap:anywhere;margin:7px 0 5px}.team-chat-message-actions{display:flex;gap:12px;align-items:center;justify-content:flex-end;margin-top:5px}.team-chat-text-action{border:0;background:transparent;color:var(--muted);font-size:10px;padding:6px 0;min-height:28px}.team-chat-reply-preview{display:block;text-align:left;width:100%;margin:8px 0;padding:7px 9px;border:0;border-left:3px solid var(--accent);border-radius:5px;background:color-mix(in srgb,var(--accent) 5%,var(--card));color:var(--text);font-size:11px;line-height:1.4}.team-chat-reply-preview strong,.team-chat-reply-preview span{display:block;overflow:hidden;white-space:nowrap;text-overflow:ellipsis;max-width:260px}.team-chat-reply-preview strong{color:var(--accent);margin-bottom:3px}.team-chat-job-link{font-size:11px;margin:5px 0;padding:6px 8px;border:1px solid color-mix(in srgb,var(--accent) 30%,var(--line));border-radius:7px;background:transparent;color:var(--accent);max-width:100%}.team-chat-job-link:disabled{cursor:default;opacity:.65}.team-chat-attachment{display:grid;gap:5px;margin-top:8px;min-width:0}.team-chat-file-button{min-height:42px;text-align:left;border:1px solid var(--line);border-radius:9px;background:var(--input);color:var(--text);padding:9px 11px;font-size:13px;overflow-wrap:anywhere}.team-chat-attachment>small{font-size:10px;color:var(--muted);overflow-wrap:anywhere}.team-chat-attachment img,.team-chat-attachment video{max-width:100%;max-height:330px;border-radius:10px;object-fit:contain}.team-chat-attachment audio{width:min(100%,280px);height:44px}.team-chat-pins>details{padding:12px 14px;border:1px solid var(--line);border-radius:12px;background:var(--card);margin-bottom:12px}.team-chat-pins summary{cursor:pointer;font-size:13px;font-weight:650;color:var(--accent)}.team-chat-pins .team-chat-message{margin-top:12px;max-width:100%}.team-chat-compose{border:1px solid var(--line);border-top:0;border-radius:0 0 18px 18px;background:var(--card);padding:12px}.team-chat-text-label{font-size:0;margin:0}.team-chat-text-label textarea{margin:0!important;border:1px solid var(--cm-blue-soft-line,var(--line))!important;border-radius:10px;background:transparent!important;min-height:72px;padding:10px 12px!important;font-size:14px!important;resize:vertical;box-shadow:none}.team-chat-compose-options{display:flex;gap:6px;flex-wrap:wrap;margin-top:8px}.team-chat-compose-options>.chip{font-size:11px;padding:7px 9px;min-height:35px}.team-chat-compose-bottom{display:flex;justify-content:space-between;align-items:center;gap:14px;padding-top:10px;margin-top:8px;border-top:1px solid var(--line)}.team-chat-key-hint{font-size:10px;color:var(--muted)}.team-chat-send{width:auto!important;min-height:42px!important;font-size:13px!important;padding:11px 22px!important;border-radius:10px!important}.team-chat-compose-reply{display:flex;align-items:center;gap:10px;border-left:3px solid var(--accent);padding:8px 10px;background:var(--chat-soft);border-radius:5px;margin-bottom:8px}.team-chat-compose-reply>div{min-width:0;flex:1}.team-chat-compose-reply strong,.team-chat-compose-reply small{display:block;font-size:11px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}.team-chat-compose-reply small{margin-top:4px;color:var(--muted)}.team-chat-remove{border:0;background:transparent;color:var(--muted);font-size:21px;min-width:32px;min-height:32px;padding:3px}.team-chat-compose-files{display:grid;gap:6px}.team-chat-draft-file{display:flex;align-items:center;gap:8px;padding:9px;border:1px solid var(--line);border-radius:9px;background:var(--input)}.team-chat-draft-file>div{flex:1;min-width:0}.team-chat-draft-file strong,.team-chat-draft-file small{display:block;font-size:11px;overflow-wrap:anywhere}.team-chat-draft-file small{color:var(--muted);margin-top:4px;line-height:1.4}.team-chat-selected-mentions{display:flex;gap:5px;flex-wrap:wrap}.team-chat-mention-chip{font-size:10px;border:0;border-radius:12px;color:var(--accent);background:var(--chat-soft);padding:5px 8px;margin-top:5px}.team-chat-people{display:flex;gap:6px;flex-wrap:wrap;max-height:180px;overflow:auto;border:1px solid var(--line);border-radius:10px;padding:9px}.team-chat-people>.hint{flex:1 1 100%;margin:0 0 3px}.team-chat-person{font-size:12px;background:var(--input);color:var(--text);border:1px solid var(--line);border-radius:9px;min-height:34px;padding:7px 9px}.team-chat-job-panel{font-size:12px;margin:8px 0!important}.team-chat-job-panel input{font-size:13px!important;min-height:38px!important;padding:8px!important}.team-chat .is-recording{color:var(--error);border-color:var(--error)}
@media(max-width:550px){.team-chat-heading{display:block;margin-top:15px}.team-chat-heading-actions{justify-content:flex-start;margin-top:12px}.team-chat-frame{height:48dvh;min-height:220px;padding:12px 8px}.team-chat-message{max-width:97%}.team-chat-avatar{width:25px;height:25px;font-size:9px;border-radius:8px}.team-chat-bubble{padding:9px 10px 5px}.team-chat-message-text{font-size:13px}.team-chat-compose{padding:10px}.team-chat-key-hint{display:none}.team-chat-compose-bottom{justify-content:flex-end}.team-chat-send{padding-left:25px!important;padding-right:25px!important}.team-chat-open{font-size:12px}.team-chat-heading h1{font-size:25px}}
@media(min-width:1000px){.team-chat{max-width:1000px;margin:0 auto}.team-chat-frame{height:58dvh}.team-chat-message{max-width:80%}.team-chat-compose-options{gap:8px}.team-chat-heading-actions .chip{font-size:12px}}
/* A dedicated conversation keeps the shared workspace controls on other pages. */
body.team-chat-screen #workflowNavigationZone,body.team-chat-screen #workflowQueuesZone,body.team-chat-screen #desktopShortcuts,body.team-chat-screen #managerTaskShortcuts,body.team-chat-screen #employeeHome{display:none!important}
body.team-chat-screen .workspace-navigation{position:static!important;top:auto!important;margin:0 0 10px!important}
body.team-chat-screen .brand{margin-bottom:12px;padding-bottom:12px}
body.team-chat-screen #teamChat{display:flex;flex-direction:column;height:calc(100dvh - 160px);min-height:560px;padding-bottom:0}
body.team-chat-screen .team-chat-heading{flex:none;margin:0 0 12px}
body.team-chat-screen .team-chat-eyebrow{display:none}
body.team-chat-screen .team-chat-heading h1{margin:0 0 4px}
body.team-chat-screen .team-chat-status:empty{display:none}
body.team-chat-screen .team-chat-pins{flex:none}
body.team-chat-screen .team-chat-pins>details{margin-bottom:10px}
body.team-chat-screen .team-chat-frame{height:auto;min-height:160px;flex:1 1 auto}
body.team-chat-screen .team-chat-compose{flex:none}
@media(max-width:550px){body.team-chat-screen main{padding-top:12px}body.team-chat-screen #teamChat{height:calc(100dvh - 145px);min-height:520px}body.team-chat-screen .team-chat-heading{display:flex;gap:10px;align-items:center;margin:0 0 10px}body.team-chat-screen .team-chat-heading>div:first-child{min-width:0;flex:1}body.team-chat-screen .team-chat-heading h1{font-size:22px}body.team-chat-screen .team-chat-subtitle{font-size:11px;line-height:1.4}body.team-chat-screen .team-chat-heading-actions{margin:0;flex:none;max-width:145px;gap:5px;justify-content:flex-end}body.team-chat-screen .team-chat-heading-actions .chip{font-size:10px;min-height:30px;padding:6px 8px}body.team-chat-screen .team-chat-text-label textarea{min-height:52px;height:58px;padding:8px 12px!important}body.team-chat-screen .team-chat-compose-options{margin-top:4px}body.team-chat-screen .team-chat-compose-options>.chip{font-size:10px;min-height:31px;padding:6px 8px}body.team-chat-screen .team-chat-compose-bottom{margin-top:6px;padding-top:8px}}
/* Author photos and award frames use the same profile component as the CRM. */
.team-chat-profile{display:inline-flex;flex:none;align-items:flex-start;margin-top:2px}
.team-chat-profile .cm-person{gap:0}
.team-chat-profile .cm-person-name{display:none}
.team-chat-profile .cm-avatar{width:32px;height:32px;flex-basis:32px}
@media(max-width:550px){.team-chat-profile .cm-avatar{width:29px;height:29px;flex-basis:29px}}
.chat-emoji-panel{max-height:min(172px,30dvh);overflow:auto;margin-top:7px;padding:6px;border:1px solid var(--line);border-radius:9px;background:var(--input)}
.chat-emoji-grid{display:grid;grid-template-columns:repeat(auto-fit,minmax(40px,1fr));gap:3px;max-width:410px}
.chat-emoji-option,.chat-reaction-badge,.chat-reaction-trigger{width:auto;min-width:0;margin:0;border:1px solid var(--line);color:var(--text);background:var(--card);cursor:pointer}
.chat-emoji-option{min-height:40px;padding:2px 4px;border-radius:7px;font-size:20px;line-height:1.2}
.chat-emoji-option:hover,.chat-reaction-badge:hover,.chat-reaction-trigger:hover{border-color:var(--accent)}
.chat-emoji-toggle{font-size:17px!important;line-height:1}
.team-chat-compose-toolbar{display:grid;grid-template-columns:minmax(0,1fr) auto;align-items:end;gap:8px;margin-top:8px}
.team-chat-compose .team-chat-compose-toolbar>.team-chat-compose-options{min-width:0;margin-top:0}
.team-chat-dice-tools{display:inline-flex;align-items:center;gap:inherit}
.team-chat-compose .team-chat-record.chip{
  display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
  width:44px;height:44px;min-width:44px;min-height:44px;padding:0;border-radius:50%;color:var(--text);
}
.team-chat-compose .team-chat-record.is-recording{color:var(--error);border-color:var(--error)}
.team-chat-record{touch-action:none;user-select:none;-webkit-touch-callout:none}
.team-chat-record:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.team-chat-record-mic{width:21px;height:21px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.team-chat-record.is-recording .team-chat-record-mic{display:none}
.team-chat-record-stop{width:11px;height:11px;border-radius:2px;background:currentColor}
.team-chat-record-time{font-size:10px;font-variant-numeric:tabular-nums;line-height:1}
.team-chat-record.is-holding{position:relative}
.team-chat-record.is-holding::before{
  content:"↑ Зафиксировать запись";position:absolute;z-index:1;right:0;bottom:calc(100% + 6px);
  padding:6px 8px;border:1px solid var(--line);border-radius:8px;background:var(--card);color:var(--text);
  font-size:11px;white-space:nowrap;pointer-events:none;
}
.team-chat-compose-toolbar.is-voice-locked>:not(.team-chat-record-locked),
.team-chat-compose-toolbar.is-voice-locked~.team-chat-compose-bottom{display:none}
.team-chat-record-locked{grid-column:1/-1;display:flex;align-items:center;gap:6px;min-width:0}
.team-chat-record-locked-status{display:flex;align-items:center;flex:1 1 auto;flex-wrap:wrap;gap:4px;color:var(--error);font-size:12px;line-height:1.15}
.team-chat-record-locked-status svg{width:15px;height:15px;fill:none;stroke:currentColor;stroke-width:1.8;stroke-linecap:round;stroke-linejoin:round}
.team-chat-record-locked-time{font-variant-numeric:tabular-nums}
.team-chat-record-locked>button{width:auto;min-width:0;min-height:44px;margin:0;padding:7px 9px;font-size:12px;white-space:nowrap}
@media(max-width:550px){body.team-chat-screen .team-chat-compose-toolbar{margin-top:4px}}
.team-chat-compose .cm-chat-dice-button.chip{min-width:44px;min-height:44px!important;font-size:18px!important;line-height:1;padding:6px 8px}
.cm-chat-dice-sound-toggle.chip{min-width:44px;min-height:44px;font-size:17px;line-height:1;padding:6px 8px}
.cm-chat-dice-sound-toggle[aria-pressed="false"]{background:var(--input)}
.team-dice-game-header-actions{display:flex;align-items:center;gap:6px}
.team-dice-game-header-actions .cm-chat-dice-sound-toggle.chip{min-width:36px;min-height:36px}
.cm-chat-dice-result{display:inline-flex;align-items:center;gap:5px;width:max-content;max-width:100%;margin:0;color:var(--text);font-size:15px;font-weight:700;line-height:1.2;white-space:nowrap}
:is(.team-chat,.team-dice-game-dialog) button.cm-chat-dice-result{
  appearance:none;min-width:0;min-height:28px;margin:-2px -4px;padding:2px 4px;border:0;border-radius:7px;
  background:transparent;color:var(--text);box-shadow:none;font-family:inherit;cursor:pointer;
}
:is(.team-chat,.team-dice-game-dialog) button.cm-chat-dice-result:hover{background:color-mix(in srgb,var(--accent) 12%,transparent)}
:is(.team-chat,.team-dice-game-dialog) button.cm-chat-dice-result:focus-visible{outline:2px solid var(--accent);outline-offset:2px}
.cm-chat-dice-preview{
  box-sizing:border-box;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);place-items:center;
  width:24px;height:24px;padding:3px;border:1px solid #c2cee4;border-radius:5px;
  background:linear-gradient(145deg,#fff,#dbe6f7);box-shadow:0 1px 2px #09152f45;
}
.cm-chat-dice-preview .cm-chat-die-pip{width:77%;background:#273751;box-shadow:none}
.cm-chat-dice-preview[data-face="1"] .cm-chat-die-pip{width:95%;background:#d84b5b}
.team-chat-compose .team-dice-game-launch.chip{min-height:44px!important;white-space:nowrap;border-color:var(--accent);font-weight:700}
.team-dice-game-dialog{box-sizing:border-box;width:min(420px,calc(100vw - 24px));max-height:calc(100dvh - 24px);overflow:auto;padding:16px;border:1px solid var(--line);border-radius:16px;background:var(--card);color:var(--text)}
.team-dice-game-dialog::backdrop{background:#0009}
.team-dice-game-dialog h2{margin:0;font-size:1.12rem}
.team-dice-game-dialog h3{margin:12px 0 5px;font-size:.95rem}
.team-dice-game-dialog p{margin:6px 0;line-height:1.4}
.team-dice-game-dialog button{min-height:44px}
.team-dice-game-header,.team-dice-game-challenge-row{display:flex;align-items:center;justify-content:space-between;gap:8px}
.team-dice-game-challenge-row{flex-wrap:wrap;padding:7px 0;border-block:1px solid var(--line)}
.team-dice-game-challenge{min-width:min(14ch,100%);flex:1;overflow-wrap:anywhere}
.team-dice-game-challenge-row button{flex:none;max-width:100%}
.team-dice-game-status{font-size:.86rem}
.team-dice-game-status[data-error=true]{color:var(--error)}
.team-dice-game-rolls{display:flex;flex-wrap:wrap;gap:4px 16px}
.team-dice-game-roll{display:flex;align-items:center;gap:6px;min-width:0;overflow-wrap:anywhere}
.team-dice-game-winner{display:block;overflow-wrap:anywhere}
.team-dice-game-leaders{list-style:none;margin:0;padding:0;max-height:24dvh;overflow:auto}
.team-dice-game-leaders li{display:flex;align-items:center;justify-content:space-between;gap:8px;padding:5px 0;border-bottom:1px solid var(--line);overflow-wrap:anywhere}
.team-dice-game-leaders strong{font-variant-numeric:tabular-nums;flex:none}
.cm-chat-dice-result.is-rolling{visibility:hidden}
.cm-chat-dice-stage{
  position:fixed;z-index:60;display:grid;place-items:center;overflow:hidden;pointer-events:none;
  border-radius:20px;background:radial-gradient(ellipse at 50% 48%,rgba(77,119,178,.30),rgba(10,17,30,.60) 72%);
  animation:cm-dice-stage 2050ms linear both;
}
.cm-chat-dice-stage.has-six{--cm-confetti-fire:1770ms;animation-duration:3050ms}
.cm-chat-dice-tray{display:flex;gap:calc(var(--cm-die-size) * .28);perspective:calc(var(--cm-die-size) * 4.4);transform-style:preserve-3d}
.cm-chat-die-object,.cm-chat-die-flight,.cm-chat-die-cube{
  width:var(--cm-die-size);height:var(--cm-die-size);position:relative;transform-style:preserve-3d;
}
.cm-chat-die-object::before{
  content:'';position:absolute;left:2%;right:2%;top:104%;height:19%;border-radius:50%;background:#030916aa;
  filter:blur(calc(var(--cm-die-size) * .09));animation:cm-dice-shadow 2050ms ease-out both;
}
.cm-chat-die-flight{animation:cm-dice-flight 2050ms cubic-bezier(.2,.7,.25,1) both}
.cm-chat-die-cube{animation:cm-dice-spin 2050ms cubic-bezier(.2,.58,.25,1) both}
.cm-chat-die-object:nth-child(2) .cm-chat-die-flight{--cm-flight-direction:-1}
.cm-chat-die-face{
  position:absolute;inset:0;box-sizing:border-box;display:grid;grid-template:repeat(3,1fr)/repeat(3,1fr);place-items:center;
  padding:14%;border:1px solid #c2cee4;border-radius:11%;backface-visibility:hidden;
  background:linear-gradient(145deg,#fff 8%,#f1f5fd 55%,#d6e2f7);
  box-shadow:inset 0 0 0 2px #ffffff9e,inset 0 -10px 22px #7897bd38;
  transform:rotateX(var(--cm-face-x)) rotateY(var(--cm-face-y)) translateZ(calc(var(--cm-die-size) * .5));
}
.cm-chat-die-pip{
  width:72%;aspect-ratio:1;border-radius:50%;background:radial-gradient(circle at 37% 31%,#435272,#172440 72%);
  box-shadow:inset 0 2px 4px #0007,0 1px 0 #fff8;
}
.cm-chat-die-face[data-face="1"] .cm-chat-die-pip{width:92%;background:radial-gradient(circle at 35% 29%,#ff7d77,#cf344d 73%)}
.cm-chat-dice-confetti{
  --cm-confetti-size:clamp(6px,calc(var(--cm-die-size) * .045),13px);
  position:absolute;inset:0;z-index:1;pointer-events:none;perspective:820px;perspective-origin:50% 69%;
}
.cm-chat-confetti-burst{position:absolute;top:69%;width:0;height:0;transform-style:preserve-3d}
.cm-chat-confetti-burst.is-left{left:3%;--cm-flash-color:#ff339c;--cm-flash-halo:#ff6e29;--cm-flash-angle:-28deg}
.cm-chat-confetti-burst.is-right{right:3%;--cm-flash-color:#43e4ff;--cm-flash-halo:#8656ff;--cm-flash-angle:28deg}
.cm-chat-confetti-burst::before,.cm-chat-confetti-burst::after{
  content:'';position:absolute;top:0;left:0;opacity:0;pointer-events:none;
}
.cm-chat-confetti-burst::before{
  width:clamp(130px,calc(var(--cm-die-size) * 1.3),310px);aspect-ratio:1;border-radius:50%;
  background:radial-gradient(circle,#fff 3%,#fff8bc 13%,var(--cm-flash-color) 32%,var(--cm-flash-halo) 47%,transparent 71%);
  animation:cm-confetti-flash 460ms ease-out var(--cm-confetti-fire) both;
}
.cm-chat-confetti-burst::after{
  width:clamp(100px,calc(var(--cm-die-size) * 1.1),270px);height:clamp(26px,calc(var(--cm-die-size) * .23),68px);
  background:radial-gradient(ellipse,#fff 6%,#ffeaa0 23%,var(--cm-flash-color) 39%,transparent 72%);
  animation:cm-confetti-flash-ray 285ms ease-out var(--cm-confetti-fire) both;
}
.cm-chat-confetti-piece{
  position:absolute;top:0;left:0;width:var(--cm-confetti-size);height:var(--cm-confetti-size);
  background:var(--cm-confetti-color,#fff14d);box-shadow:inset 0 1px 1px #fff9,0 1px 2px #10053155;opacity:0;
  animation:cm-confetti-flight 1080ms linear calc(var(--cm-confetti-fire) + var(--cm-confetti-delay,0ms)) both;
}
.cm-chat-confetti-piece.is-square{border-radius:1px}
.cm-chat-confetti-piece.is-ribbon{width:calc(var(--cm-confetti-size) * 1.65);height:calc(var(--cm-confetti-size) * .46);border-radius:40% 12% 40% 12%}
.cm-chat-confetti-piece.is-dot{width:calc(var(--cm-confetti-size) * .77);height:calc(var(--cm-confetti-size) * .77);border-radius:50%}
@keyframes cm-confetti-flash{
  0%{opacity:0;transform:translate(-50%,-50%) scale(.18)}
  12%{opacity:.96;transform:translate(-50%,-50%) scale(.72)}
  100%{opacity:0;transform:translate(-50%,-50%) scale(1.35)}
}
@keyframes cm-confetti-flash-ray{
  0%{opacity:0;transform:translate(-50%,-50%) rotate(var(--cm-flash-angle)) scale(.2)}
  17%{opacity:1;transform:translate(-50%,-50%) rotate(var(--cm-flash-angle)) scale(1)}
  100%{opacity:0;transform:translate(-50%,-50%) rotate(var(--cm-flash-angle)) scale(1.65)}
}
@keyframes cm-confetti-flight{
  0%{opacity:0;transform:translate3d(0,0,0) rotateX(0deg) rotateY(0deg) rotateZ(0deg) scale(.42)}
  8%,76%{opacity:1}
  38%{transform:translate3d(calc(var(--cm-confetti-x) * .64),calc(var(--cm-confetti-y) * .86),calc(var(--cm-confetti-z,0px) * .54))
    rotateX(calc(var(--cm-confetti-spin) * .55)) rotateY(calc(var(--cm-confetti-spin) * .32)) rotateZ(calc(var(--cm-confetti-spin) * .49)) scale(1)}
  68%{transform:translate3d(calc(var(--cm-confetti-x) * .87),calc(var(--cm-confetti-y) * .97),calc(var(--cm-confetti-z,0px) * .86))
    rotateX(calc(var(--cm-confetti-spin) * .84)) rotateY(calc(var(--cm-confetti-spin) * .69)) rotateZ(calc(var(--cm-confetti-spin) * .78)) scale(.96)}
  100%{opacity:0;transform:translate3d(var(--cm-confetti-x),calc(var(--cm-confetti-y) + 46px),var(--cm-confetti-z,0px))
    rotateX(calc(var(--cm-confetti-spin) * 1.17)) rotateY(var(--cm-confetti-spin)) rotateZ(var(--cm-confetti-spin)) scale(.73)}
}
@keyframes cm-dice-stage{0%{opacity:0}8%,91%{opacity:1}100%{opacity:0}}
@keyframes cm-dice-flight{
  0%{transform:translate3d(calc(-32% * var(--cm-flight-direction,1)),21%,0) scale(.63) rotateX(-10deg) rotateY(12deg)}
  29%{transform:translate3d(calc(10% * var(--cm-flight-direction,1)),-24%,0) scale(1.04) rotateX(-10deg) rotateY(12deg)}
  59%{transform:translate3d(calc(6% * var(--cm-flight-direction,1)),5%,0) scale(.98) rotateX(-10deg) rotateY(12deg)}
  70%{transform:translate3d(0,-4%,0) scale(1) rotateX(-10deg) rotateY(12deg)}
  80%,100%{transform:translate3d(0,0,0) scale(1) rotateX(-10deg) rotateY(12deg)}
}
@keyframes cm-dice-spin{
  0%{transform:rotateX(-32deg) rotateY(-35deg) rotateZ(-48deg)}
  36%{transform:rotateX(315deg) rotateY(238deg) rotateZ(165deg)}
  61%{transform:rotateX(553deg) rotateY(452deg) rotateZ(310deg)}
  80%,100%{transform:rotateX(var(--cm-rest-x)) rotateY(var(--cm-rest-y)) rotateZ(360deg)}
}
@keyframes cm-dice-shadow{0%,29%{opacity:.26;transform:scale(.72)}59%{opacity:.9;transform:scale(1.03)}80%,100%{opacity:.74;transform:scale(.94)}}
@media(prefers-reduced-motion:reduce){.cm-chat-dice-stage{display:none}.cm-chat-dice-result.is-rolling{visibility:visible}}
.chat-emoji-feedback{display:block;color:var(--error);margin-top:4px}
.chat-emoji-feedback:empty{display:none}
.chat-message-activity{margin-top:5px;min-width:0}
.chat-reaction-controls,.chat-reaction-badges,.chat-reaction-picker{display:flex;align-items:center;gap:4px;flex-wrap:wrap}
.chat-reaction-badges:empty{display:none}
.chat-reaction-badge,.chat-reaction-trigger{min-height:30px;border-radius:12px;padding:2px 7px;font-size:13px;white-space:nowrap}
.chat-reaction-badge[aria-pressed=true]{background:color-mix(in srgb,var(--accent) 18%,var(--card));border-color:var(--accent)}
.chat-reaction-picker{margin-top:5px}
.chat-reaction-picker .chat-emoji-option{min-width:38px}
.chat-read-receipt{display:block;margin-top:5px;color:var(--muted);font-size:11px;line-height:1.35;overflow-wrap:anywhere}
.chat-emoji-panel[hidden],.chat-reaction-picker[hidden],.chat-read-receipt[hidden]{display:none}
.chat-message-mutation-controls,.chat-message-editor-controls{display:flex;flex-wrap:wrap;gap:6px 10px;align-items:center}
.team-chat-message-actions{flex-wrap:wrap}
.chat-message-mutation-controls{margin-top:4px}
.chat-message-delete-action{color:var(--error)}
.chat-message-edited,.chat-message-deleted{color:var(--muted);font-style:italic}
.chat-message-editor{flex:1 1 100%;margin-top:8px;min-width:0}
.chat-message-editor textarea{width:100%;min-width:0;min-height:60px;resize:vertical}
.chat-message-editor-controls{margin-top:5px}
.team-chat-message.is-emoji-only .team-chat-bubble{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:3px 7px;padding:6px 8px}
.is-emoji-only .team-chat-message-meta{grid-column:1/-1;gap:4px 7px}
.is-emoji-only .team-chat-message-text{grid-row:2;grid-column:1;margin:0;font-size:30px;line-height:1.25;white-space:nowrap}
.is-emoji-only .chat-message-activity{grid-row:2;grid-column:2;display:flex;flex-wrap:wrap;align-items:center;gap:3px 6px;margin:0;min-width:0}
.is-emoji-only .chat-reaction-picker{flex:1 0 100%}
.is-emoji-only .chat-read-receipt{margin:0}
.chat-emoji-actions{grid-row:2;grid-column:3;justify-self:end;min-width:0}
.chat-emoji-actions[open]{grid-row:3;grid-column:1/-1;justify-self:stretch}
.chat-emoji-action-toggle,.chat-emoji-reader-toggle{list-style:none;cursor:pointer}
.chat-emoji-action-toggle::-webkit-details-marker,.chat-emoji-reader-toggle::-webkit-details-marker{display:none}
.chat-emoji-action-toggle{display:grid;place-items:center;min-width:32px;min-height:30px;border:1px solid var(--line);border-radius:12px;color:var(--text);font-size:17px}
.chat-emoji-actions[open] .chat-emoji-action-toggle{width:32px;margin-left:auto}
.chat-emoji-reader-toggle{min-height:28px;display:flex;align-items:center;white-space:nowrap;text-decoration:underline dotted;text-underline-offset:2px}
.chat-emoji-reader-names{display:block;max-width:24ch;line-height:1.35;overflow-wrap:anywhere}
.chat-message-footer,.chat-message-footer>.chat-message-activity{display:flex;flex-wrap:wrap;align-items:center;gap:3px 7px;min-width:0}
.chat-message-footer{margin-top:3px}
.chat-message-footer>.chat-message-activity,.chat-message-footer .chat-read-receipt{margin:0}
.chat-message-footer>.chat-emoji-actions{margin-left:auto}
.chat-message-footer>.chat-emoji-actions[open],.chat-message-footer .chat-reaction-picker{flex:1 0 100%}
.team-chat-message.is-dice .team-chat-bubble{
  display:grid;grid-template-columns:max-content minmax(0,1fr);align-items:center;gap:2px 7px;padding:5px 8px;
}
.is-dice .team-chat-message-meta{grid-column:1/-1;margin-bottom:0;gap:3px 7px}
.is-dice .cm-chat-dice-result{grid-row:2;grid-column:1}
.is-dice .chat-message-footer{grid-row:2;grid-column:2;margin:0;justify-content:flex-end}

/* Royal Jackpot is a native chat dialog with its game styles scoped to the shadow host. */
.team-slot-game-dialog {
  box-sizing: border-box;
  width: min(1050px, calc(100% - 24px));
  max-width: none;
  height: min(780px, calc(100dvh - 24px));
  max-height: none;
  padding: 0;
  border: 1px solid #6f493d;
  border-radius: 20px;
  background: #140e12;
  overflow: auto;
  overscroll-behavior: contain;
}
.team-slot-game-dialog::backdrop { background: #11090be8; }
@media (max-width: 735px) {
  .team-slot-game-dialog {
    width: 100%;
    height: 100dvh;
    margin: 0;
    border: 0;
    border-radius: 0;
  }
}

:host(.cm-royal-surface) {
  color-scheme: dark;
  --paper: #f9ead8;
  --muted: #bfa99d;
  --gold: #e9b762;
  --lit: #ffe2a7;
  --edge: #5b392b;
  --cell: 104px;
  --window: 144px;
  font: 15px Inter, "Segoe UI", system-ui, sans-serif;
}
:host(.cm-royal-surface) * { box-sizing: border-box; }
:host(.cm-royal-surface) {
  margin: 0; min-height: 100%; color: var(--paper);
  background:
    radial-gradient(ellipse at 44% 16%, #3f1a25 0, #25141b 36%, transparent 69%),
    #140e12;
  background-attachment: fixed;
}
:host(.cm-royal-surface) button { font: inherit; cursor: pointer; touch-action: manipulation; }
:host(.cm-royal-surface) button:focus-visible, :host(.cm-royal-surface) summary:focus-visible { outline: 2px solid #ffe0a1; outline-offset: 4px; }
:host(.cm-royal-surface) button:disabled { cursor: default; }
:host(.cm-royal-surface) .frame { width: min(100% - 40px, 970px); margin-inline: auto; }
:host(.cm-royal-surface) .top {
  min-height: 68px; padding: 12px 0; display: flex; align-items: center; justify-content: space-between;
  gap: 14px; border-bottom: 1px solid #a7785b36;
}
:host(.cm-royal-surface) .section-name { display: flex; align-items: center; gap: 10px; font-weight: 640; }
:host(.cm-royal-surface) .mark { color: var(--lit); font: 22px Georgia, serif; text-shadow: 0 0 12px #d79455a3; }
:host(.cm-royal-surface) .quiet {
  display: inline-flex; justify-content: center; align-items: center; gap: 8px; padding: 9px 12px;
  min-height: 42px; border-radius: 8px; color: var(--paper); font-size: 13px;
  background: #2b1b21; border: 1px solid #6f493d;
}
:host(.cm-royal-surface) .quiet:hover { border-color: #d99d61; }
:host(.cm-royal-surface) .sound-icon { font-size: 17px; line-height: 1; color: var(--gold); }
:host(.cm-royal-surface) .layout { display: grid; grid-template-columns: minmax(0, 640px) minmax(235px, 286px); gap: 37px; align-items: center; margin-top: 33px; }
:host(.cm-royal-surface) .machine {
  --metal: linear-gradient(102deg, #6f4328, #e1ab56 7%, #ffe2a2 13%, #a76a3a 25%, #f1bf6d 43%, #7b482c 65%, #f2be72 81%, #ffdc85 91%, #6f442a);
  position: relative; min-width: 0; isolation: isolate; border: 2px solid #c49151;
  border-radius: 60px 60px 24px 24px; padding: 5px;
  background: var(--metal);
  box-shadow: 0 22px 52px #0b0407bd, inset 0 1px 2px #ffebc4, 0 0 34px #d0803826;
}
:host(.cm-royal-surface) .machine::after {
  content: ""; position: absolute; z-index: -1; pointer-events: none; inset: 7px;
  border-radius: inherit; box-shadow: 0 0 22px #edac58; opacity: 0; transition: opacity .3s;
}
:host(.cm-royal-surface) .machine[data-result="jackpot"]::after { opacity: .72; }
:host(.cm-royal-surface) .cabinet {
  position: relative; padding: 9px 16px 15px; border-radius: 53px 53px 19px 19px;
  border: 1px solid #462f22; background:
    linear-gradient(121deg, #ffebbe0a 15%, transparent 25% 73%, #e9aa6512 82%, transparent 100%),
    linear-gradient(#481923 0%, #31131d 41%, #211116 77%, #362027 100%);
  box-shadow: inset 0 0 0 2px #d0955456, inset 0 -9px 19px #130a0e;
}
:host(.cm-royal-surface) .marquee {
  position: relative; display: grid; place-items: center; text-align: center; min-height: 158px; padding: 16px 32px 21px;
  border-radius: 43px 43px 12px 12px; border: 1px solid #b5844b;
  background:
    radial-gradient(ellipse at 50% 10%, #ae4b3c 0%, #711926 52%, #3d111a 91%),
    #661720;
  box-shadow: inset 0 0 0 4px #271018, inset 0 0 0 5px #b37b4875, inset 0 -18px 31px #2d0818bc, 0 6px 8px #1b0811a0;
  overflow: hidden;
}
:host(.cm-royal-surface) .marquee::before {
  content: ""; position: absolute; inset: 4px 6px; border-radius: inherit; pointer-events: none;
  background: repeating-conic-gradient(from 2deg at 50% 121%, #ffd99a 0deg 1deg, transparent 1deg 13deg);
  opacity: .14; mask-image: linear-gradient(#000, transparent 90%);
}
:host(.cm-royal-surface) .bulb-rail { position: absolute; inset: auto 24px 9px; display: flex; justify-content: space-between; pointer-events: none; }
:host(.cm-royal-surface) .bulb {
  display: block; width: 5px; height: 5px; border-radius: 50%;
  background: #ffe1a2; box-shadow: 0 0 2px #fff4ce, 0 0 8px 2px #fe9d45; opacity: .78;
}
:host(.cm-royal-surface) [data-result="jackpot"] .bulb { animation: cm-royal-lamp 1.1s ease-in-out infinite alternate; animation-delay: calc(var(--i) * 45ms); }
@keyframes cm-royal-lamp { to { opacity: .26; box-shadow: 0 0 2px #fff4ce; } }
:host(.cm-royal-surface) .title-art { position: relative; margin: 0; display: grid; justify-items: center; line-height: 1; font-family: Georgia, "Times New Roman", serif; }
:host(.cm-royal-surface) .royal-line { display: flex; align-items: center; justify-content: center; width: 100%; gap: 12px; color: #ffda9c; font-size: clamp(14px, 2.9vw, 22px); letter-spacing: .22em; padding-left: .22em; }
:host(.cm-royal-surface) .royal-line::before, :host(.cm-royal-surface) .royal-line::after { content: ""; width: 29px; height: 1px; background: linear-gradient(90deg, transparent, #f7c476); }
:host(.cm-royal-surface) .royal-line::after { transform: rotate(180deg); }
:host(.cm-royal-surface) .title-word {
  font-size: clamp(36px, 9.6vw, 76px); letter-spacing: -.038em; color: #ffe1a0; font-weight: 800;
  text-shadow: 0 1px #fff6c9, 0 3px #a0612c, 0 4px #784024, 0 6px #1f0b17, 0 10px 19px #260713a6;
}
:host(.cm-royal-surface) .title-word + .title-diamond { margin-top: 8px; color: #dba95b; font-size: 13px; text-shadow: 0 0 8px #ffa86c; }
:host(.cm-royal-surface) .game-face {
  position: relative; padding: 12px 12px 9px; margin-top: 12px; border-radius: 14px;
  border: 1px solid #98663e; background: linear-gradient(153deg, #6f3f2d, #351b1c 19%, #29171b 72%, #74462f);
  box-shadow: inset 0 0 0 2px #b7855543, 0 4px 8px #180b12;
}
:host(.cm-royal-surface) .reels-case {
  position: relative; display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 6px;
  padding: 5px; border-radius: 10px; border: 1px solid #704529; background: var(--metal);
  box-shadow: 0 2px 0 #180b0d, 0 0 0 1px #eac08173;
}
:host(.cm-royal-surface) .reel {
  position: relative; height: var(--window); border-radius: 5px; border: 1px solid #533522;
  overflow: hidden; background: #ffecc5; contain: strict;
}
:host(.cm-royal-surface) .reel-track { position: absolute; inset: 0 0 auto; display: grid; transform: translateY(calc((var(--window) - var(--cell)) / 2 - var(--cell) - 1px)); }
:host(.cm-royal-surface) .reel-cell { display: grid; place-items: center; height: var(--cell); background: linear-gradient(90deg, #d5b78f, #f6e6c7 10%, #fff6df 45%, #fff2d6 72%, #d1b48e); }
:host(.cm-royal-surface) .reel-cell img { width: min(94%, var(--cell)); height: auto; display: block; user-select: none; }
:host(.cm-royal-surface) .reel-cell span { font: bold 36px Georgia, serif; color: #912128; }
:host(.cm-royal-surface) .reel::after {
  content: ""; position: absolute; pointer-events: none; inset: 0; border-radius: inherit;
  background: linear-gradient(180deg, #281613a5, #3b201b30 16%, transparent 32% 66%, #3b201b35 83%, #291817b0),
    linear-gradient(159deg, #fff9e269 7%, #fff7df16 26%, transparent 42%);
  box-shadow: inset 0 0 8px #45251a9e;
}
:host(.cm-royal-surface) [data-result="win"] .reel[data-hit]::after, :host(.cm-royal-surface) [data-result="jackpot"] .reel[data-hit]::after { box-shadow: inset 0 0 20px #df990a, inset 0 0 0 2px #efbd60; }
:host(.cm-royal-surface) .payline { position: absolute; z-index: 2; inset: 50% -7px auto; height: 0; display: flex; justify-content: space-between; align-items: center; pointer-events: none; }
:host(.cm-royal-surface) .payline::before, :host(.cm-royal-surface) .payline::after { content: ""; width: 0; height: 0; border-block: 6px solid transparent; border-inline-start: 8px solid #e15245; filter: drop-shadow(0 0 3px #f1634f); }
:host(.cm-royal-surface) .payline::after { transform: rotate(180deg); }
:host(.cm-royal-surface) [data-result="win"] .payline::before, :host(.cm-royal-surface) [data-result="win"] .payline::after,
:host(.cm-royal-surface) [data-result="jackpot"] .payline::before, :host(.cm-royal-surface) [data-result="jackpot"] .payline::after { border-inline-start-color: #ffe4a1; filter: drop-shadow(0 0 5px #fbab54); }
:host(.cm-royal-surface) .message {
  margin: 0; min-height: 31px; padding: 9px 0 1px; display: grid; place-items: center;
  color: #dbcab4; font-size: .82rem; line-height: 1.25; text-align: center;
}
:host(.cm-royal-surface) [data-result="win"] .message, :host(.cm-royal-surface) [data-result="jackpot"] .message { color: #ffe0a1; font-weight: 680; }
:host(.cm-royal-surface) .meters { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 7px; margin-top: 12px; }
:host(.cm-royal-surface) .meter {
  min-width: 0; margin: 0; padding: 8px 5px 7px; text-align: center; border: 1px solid #7b5141; border-radius: 7px;
  background: linear-gradient(#21151b, #170e14); box-shadow: inset 0 2px 6px #0e090d, 0 1px #ab776b35;
}
:host(.cm-royal-surface) .meter dt { font-size: .65rem; letter-spacing: .12em; font-weight: 660; color: #c0a999; }
:host(.cm-royal-surface) .meter dd {
  margin: 2px 0 0; color: #ffce7c; text-shadow: 0 0 10px #ee994a66; font-size: clamp(20px, 5.1vw, 29px);
  font-weight: 670; font-variant-numeric: tabular-nums; line-height: 1.1; overflow-wrap: anywhere;
}
:host(.cm-royal-surface) .meter dd[data-wide-value] { font-size: clamp(13px, 3.6vw, 23px); }
:host(.cm-royal-surface) .controls { display: grid; grid-template-columns: minmax(110px,.73fr) minmax(0,1.35fr) 51px; gap: 9px; align-items: stretch; margin-top: 12px; min-height: 59px; }
:host(.cm-royal-surface) .bet-controls { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
:host(.cm-royal-surface) .key, :host(.cm-royal-surface) .spin {
  border: 1px solid #b78150; border-radius: 8px; box-shadow: inset 0 1px #ffecd17a, inset 0 -4px #2c1419a6, 0 3px 0 #0e090c;
  min-height: 48px; font-weight: 750; color: #ffe9c5;
}
:host(.cm-royal-surface) .key { background: linear-gradient(#613e36, #372328); font-size: 1.54rem; }
:host(.cm-royal-surface) .key:hover:not(:disabled) { background: linear-gradient(#84534a, #503139); }
:host(.cm-royal-surface) .key:disabled { color: #a89488; opacity: .56; }
:host(.cm-royal-surface) .spin {
  background: linear-gradient(#c34c45, #83222f 64%, #581221);
  color: #fff0ce; text-shadow: 0 1px 2px #451020; font-size: .96rem; letter-spacing: .11em; text-transform: uppercase;
}
:host(.cm-royal-surface) .spin:hover:not(:disabled) { background: linear-gradient(#dd6157, #9b2739 64%, #6f1930); }
:host(.cm-royal-surface) .spin:disabled { color: #e7ba9c; opacity: .77; }
:host(.cm-royal-surface) .key:active:not(:disabled), :host(.cm-royal-surface) .spin:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 2px 5px #200d17a8, 0 1px #10070d; }
:host(.cm-royal-surface) .lever {
  position: relative; min-width: 46px; min-height: 48px; padding: 0; border-radius: 8px; border: 1px solid #79513e;
  background: linear-gradient(#412833, #251820); box-shadow: inset 0 2px 6px #1b0d16;
}
:host(.cm-royal-surface) .lever-arm {
  position: absolute; inset: 9px auto 10px 50%; width: 7px; transform: translateX(-50%);
  transform-origin: 50% 87%; border-radius: 4px; transition: transform .2s cubic-bezier(.24,.8,.33,1.3);
  background: linear-gradient(90deg, #55413a, #ffeece, #ab8264, #53372f);
  box-shadow: 1px 2px 3px #10090d;
}
:host(.cm-royal-surface) .lever-arm::after {
  content: ""; position: absolute; width: 17px; height: 17px; left: 50%; top: -3px; transform: translateX(-50%);
  border-radius: 50%; background: radial-gradient(circle at 35% 25%, #ffd4a2, #ce4e43 34%, #721529 75%);
  box-shadow: 0 2px 3px #180a12;
}
:host(.cm-royal-surface) .lever::after { content: ""; position: absolute; inset: auto auto 6px 50%; transform: translateX(-50%); width: 16px; height: 10px; border-radius: 50%; border: 1px solid #c68d57; background: linear-gradient(#b68560,#604131); }
:host(.cm-royal-surface) .lever:active .lever-arm, :host(.cm-royal-surface) .lever.is-pulled .lever-arm { transform: translateX(-50%) rotate(-123deg) scaleY(.8); }
:host(.cm-royal-surface) .machine-meta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 4px 12px; padding: 10px 3px 0; color: #d0bdb1; font-size: .75rem; }
:host(.cm-royal-surface) .reset { display: inline-flex; align-items: center; min-height: 36px; border: 0; padding: 0 5px; color: #edc38f; background: none; font-size: inherit; text-underline-offset: .18em; }
:host(.cm-royal-surface) .reset:hover:not(:disabled) { text-decoration: underline; }
:host(.cm-royal-surface) .reset:disabled { opacity: .5; }
:host(.cm-royal-surface) .paytable { min-width: 0; border-radius: 14px; border: 1px solid #694639; background: #25171dd9; box-shadow: 0 10px 32px #1408106e; }
:host(.cm-royal-surface) .paytable summary { min-height: 50px; padding: 14px 15px; display: flex; align-items: center; justify-content: space-between; list-style: none; cursor: pointer; color: #ffe2b6; font-weight: 650; }
:host(.cm-royal-surface) .paytable summary::-webkit-details-marker { display: none; }
:host(.cm-royal-surface) .paytable summary::after { content: "⌄"; font-size: 18px; color: #d6a375; }
:host(.cm-royal-surface) .paytable[open] summary::after { transform: rotate(180deg); }
:host(.cm-royal-surface) .paytable-body { padding: 0 12px 13px; }
:host(.cm-royal-surface) .pay-list { list-style: none; margin: 0; padding: 0; }
:host(.cm-royal-surface) .pay-row { display: grid; grid-template-columns: 54px 1fr auto; gap: 5px; align-items: center; min-height: 38px; padding: 4px 6px; color: #e9d4c2; font-size: .87rem; border-top: 1px solid #a97c5b2e; }
:host(.cm-royal-surface) .pay-row.is-jackpot { color: #ffdb97; background: #a56c2e18; border-radius: 6px; }
:host(.cm-royal-surface) .pay-icon { width: 31px; height: 29px; object-fit: contain; display: block; }
:host(.cm-royal-surface) .pay-figure { display: flex; align-items: center; gap: 1px; color: #d2ab86; font-size: .72rem; }
:host(.cm-royal-surface) .mult { color: #f4cc8d; font-weight: 650; font-variant-numeric: tabular-nums; }
:host(.cm-royal-surface) .pay-note { margin: 11px 6px 0; color: #c8b2a6; font-size: .76rem; line-height: 1.4; }
:host(.cm-royal-surface) .celebration {
  position: absolute; z-index: 6; inset: 3px 3px auto; height: 70%; overflow: hidden; display: grid;
  place-items: center; pointer-events: none; border-radius: 49px 49px 10px 10px;
}
:host(.cm-royal-surface) .celebration[hidden] { display: none; }
:host(.cm-royal-surface) .celebrate-text {
  z-index: 1; width: 100%; padding: 20px 8px; text-align: center; color: #ffe9ab;
  text-shadow: 0 2px #875229, 0 4px #300d17, 0 0 18px #ffb03a;
  background: linear-gradient(90deg, transparent, #3b1025e8 16% 84%, transparent);
  font: bold clamp(27px, 7.9vw, 58px) Georgia, serif;
  animation: cm-royal-cheer .65s cubic-bezier(.16,1,.3,1) both;
}
:host(.cm-royal-surface) .celebrate-text span { display: block; margin-top: 3px; font: 750 .49em system-ui, sans-serif; }
@keyframes cm-royal-cheer { from { opacity: 0; transform: translateY(17px) scale(.75); } to { opacity: 1; transform: none; } }
:host(.cm-royal-surface) .coin {
  position: absolute; width: var(--size); height: var(--size); top: -30px; left: var(--left); border-radius: 50%; border: 1px solid #fff0ae;
  background: radial-gradient(circle at 27% 23%, #fff6b9, #eebb54 38%, #c2842c 66%, #f1ca68 88%);
  box-shadow: inset 0 0 0 2px #ad6b30, 0 0 5px #edac5266; animation: cm-royal-coins var(--time) linear var(--delay) both;
}
@keyframes cm-royal-coins { to { transform: translate(var(--drift), 430px) rotateY(760deg) rotateZ(160deg); opacity: .15; } }
:host(.cm-royal-surface) .page-bottom { min-height: 29px; }
@media(max-width: 735px) {
  :host(.cm-royal-surface) .frame { width: min(100% - 28px, 580px); }
  :host(.cm-royal-surface) .layout { grid-template-columns: minmax(0,1fr); gap: 16px; margin-top: 16px; }
  :host(.cm-royal-surface) .top { min-height: 56px; padding: 7px 0; }
  :host(.cm-royal-surface) .marquee { min-height: 134px; }
}
@media(max-width: 460px) {
  :host(.cm-royal-surface) { --cell: 81px; --window: 113px; }
  :host(.cm-royal-surface) .frame { width: calc(100% - 24px); }
  :host(.cm-royal-surface) .machine { border-radius: 42px 42px 18px 18px; padding: 4px; }
  :host(.cm-royal-surface) .cabinet { padding: 7px 9px 7px; border-radius: 36px 36px 13px 13px; }
  :host(.cm-royal-surface) .marquee { min-height: 111px; padding-inline: 14px; border-radius: 31px 31px 9px 9px; }
  :host(.cm-royal-surface) .game-face { padding: 9px 7px 6px; margin-top: 8px; }
  :host(.cm-royal-surface) .reels-case { gap: 4px; padding: 4px; }
  :host(.cm-royal-surface) .meters, :host(.cm-royal-surface) .controls { margin-top: 9px; }
  :host(.cm-royal-surface) .meter { padding-top: 7px; }
  :host(.cm-royal-surface) .meter dt { letter-spacing: .06em; }
  :host(.cm-royal-surface) .controls { grid-template-columns: minmax(88px,.72fr) minmax(0,1.45fr) 44px; gap: 7px; min-height: 52px; }
  :host(.cm-royal-surface) .lever { min-width: 44px; }
  :host(.cm-royal-surface) .machine-meta { padding-top: 5px; }
}
@media(prefers-reduced-motion: reduce) {
  :host(.cm-royal-surface) *, :host(.cm-royal-surface) *::before, :host(.cm-royal-surface) *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
  :host(.cm-royal-surface) .coin { display: none; }
}
:host(.cm-royal-surface) { display: block; min-height: 100%; }
:host(.cm-royal-surface) .cm-royal-head-actions { display: flex; align-items: center; gap: 6px; }
:host(.cm-royal-surface) .cm-royal-close { min-width: 42px; padding-inline: 9px; font-size: 21px; line-height: 1; }

/* The district and the original casino share the chat's existing game dialog. */
.team-magnat-dialog { background: #202420; border-color: #505449; }
.team-magnat-dialog::backdrop { background: #111510dc; }
:host(.cm-magnat-surface) { display:block; min-height:100%; color-scheme:dark; }
:host(.cm-magnat-surface) .cm-magnat-app { min-height:100%; }


.md-root {
  --md-bg: #141f20;
  --md-panel: #202e2e;
  --md-fill: #263736;
  --md-line: #354c47;
  --md-text: #f2ede2;
  --md-muted: #b4c1b6;
  --md-gold: #f0c67b;
  --md-green: #abd0b4;
  --md-rust: #e4a98b;
  min-height: 100%; color: var(--md-text); background:
    radial-gradient(ellipse at 50% 0, #2d403c 0%, transparent 56%),
    var(--md-bg);
  font: 15px/1.43 "Inter", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark; text-align: left;
}
.md-root *, .md-root *::before, .md-root *::after { box-sizing: border-box; }
.md-root [hidden] { display: none !important; }
.md-root h1, .md-root h2, .md-root h3, .md-root p { margin: 0; }
.md-root button { font: inherit; cursor: pointer; touch-action: manipulation; }
.md-root button:disabled { cursor: default; }
.md-root button:focus-visible, .md-root summary:focus-visible { outline: 2px solid #f6d18d; outline-offset: 3px; }
.md-shell { max-width: 1080px; margin: auto; }
.md-header {
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding: 21px clamp(14px,3vw,29px) 17px; border-bottom: 1px solid #62766843;
}
.md-brand { min-width: 0; }
.md-brand h1 { font-size: clamp(21px,4vw,34px); letter-spacing: -.047em; line-height: 1.05; font-weight: 800; }
.md-save { margin-top: 5px !important; font-size: 11px; color: var(--md-green); display: flex; align-items: center; gap: 6px; letter-spacing: .015em; }
.md-save::before { content: ""; border-radius: 50%; width: 6px; height: 6px; flex-shrink: 0; background: currentColor; }
.md-save[data-mode="wait"] { color: var(--md-gold); }
.md-save[data-mode="warn"] { color: var(--md-rust); }
.md-head-right { display:flex; align-items:center; gap: 8px; }
.md-wallet { padding: 5px 9px; border:1px solid #5c6b52; border-radius: 9px; background: #1e2928; white-space: nowrap; font: 800 18px/1.15 system-ui, sans-serif; font-variant-numeric: tabular-nums; color: var(--md-gold); text-align: right; }
.md-wallet small { display: block; color: var(--md-muted); font-size: 9px; font-weight: 650; margin-top: 2px; }
.md-close { border: 1px solid var(--md-line); background: var(--md-fill); color: var(--md-text); min-width: 42px; min-height: 42px; border-radius: 8px; font-size: 22px !important; line-height: 1; }
.md-main { padding: 17px clamp(12px,3vw,29px) 28px; min-height: 420px; }
.md-dock {
  position: sticky; z-index: 3; bottom: 0; display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); gap: 6px;
  padding: 8px clamp(10px,3vw,29px) max(8px,env(safe-area-inset-bottom)); border-top: 1px solid var(--md-line);
  background: #1a2727f7;
}
.md-nav {
  min-height: 49px; min-width: 0; border: 1px solid transparent; border-radius: 9px; background: transparent; color: #c6d0c3;
  display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 670 !important; font-size: 13px !important;
}
.md-nav:hover { background: #2b3a36; }
.md-nav[aria-current="page"] { border-color: #6f7654; background: #334137; color: #ffe0a0; }
.md-nav i { font-size: 19px; color: var(--md-gold); font-style: normal; line-height: 1; }
.md-section-title { margin: 5px 0 10px !important; font-size: 21px; font-weight: 790; letter-spacing: -.02em; }
.md-section-sub { color: var(--md-muted); font-size: 13px; margin: -4px 0 12px !important; }
.md-status {
  display: block; min-height: 20px; margin: 0 0 9px !important; color: var(--md-green); font-size: 13px;
  padding: 0 2px; overflow-wrap: anywhere;
}
.md-status:empty { display: none; }
.md-status[data-kind="warn"] { color: var(--md-rust); }
.md-grid-home { display: grid; grid-template-columns: minmax(0,1.65fr) minmax(248px,1fr); gap: 15px; }
.md-scene {
  position: relative; isolation: isolate; width: 100%; aspect-ratio: 9/5;
  overflow: hidden; border: 1px solid #526c62; border-radius: 13px; background: #2a4344;
}
.md-scene canvas { display: block; width: 100%; height: 100%; object-fit: cover; }
.md-scene::after { content:""; position:absolute; inset: 45% 0 0; background: linear-gradient(transparent,#111b1bea); pointer-events:none; }
.md-scene-top {
  position: absolute; z-index: 1; inset: 12px auto auto 12px; max-width: 75%;
  color: #f7ecda; background: #142422d9; border: 1px solid #9cb2a475; border-radius: 6px;
  padding: 4px 8px; font-weight: 690; font-size: 11px; letter-spacing: .035em;
}
.md-caption { position:absolute; z-index:1; inset:auto 13px 10px; }
.md-caption h2 { color:#ffeecc; font-size:clamp(17px,3.2vw,27px); font-weight: 790; letter-spacing:-.026em; text-wrap: balance; }
.md-caption p { color:#dce3d2; font-size: 11px; }
.md-panel { border: 1px solid var(--md-line); border-radius: 11px; background: var(--md-panel); padding: 13px; }
.md-side { display: grid; gap: 11px; align-content: start; }
.md-panel-heading { font-size: 15px; font-weight: 760; color: var(--md-text); }
.md-stat-list { margin:8px 0 0; padding:0; list-style:none; display:grid; gap:6px; }
.md-stat-list li { display:grid; grid-template-columns:minmax(75px,auto) 1fr auto; align-items:center; gap:7px; font-size:11px; color: var(--md-muted); }
.md-stat-list strong { min-width: 17px; text-align: right; color: var(--md-text); font-variant-numeric: tabular-nums; }
.md-meter { height: 5px; appearance:none; border:0; width:100%; min-width:24px; background: #152322; border-radius: 8px; }
.md-meter::-webkit-progress-bar { background:#142322; border-radius:8px; }
.md-meter::-webkit-progress-value { background:#92a88b; border-radius:8px; }
.md-meter::-moz-progress-bar { background:#92a88b; border-radius:8px; }
.md-shift { display: grid; gap: 6px; }
.md-shift p { color: var(--md-muted); font-size:13px; }
.md-shift .md-meter { height:7px; }
.md-shift .md-meter::-webkit-progress-value { background: var(--md-gold); }
.md-shift .md-meter::-moz-progress-bar { background: var(--md-gold); }
.md-shift-title { color: var(--md-gold); font-weight:750; }
.md-job-list, .md-business-list, .md-shop-list { display: grid; gap: 8px; }
.md-row {
  display: grid; grid-template-columns: minmax(0,1fr) auto; gap: 9px; align-items: center;
  border: 1px solid var(--md-line); border-radius: 10px; background: #233230; padding: 11px;
}
.md-row h3 { font-size: 15px; font-weight: 750; line-height: 1.25; }
.md-row p { color: var(--md-muted); font-size: 12px; margin-top: 4px; }
.md-row .md-row-meta { color: var(--md-green); }
.md-primary, .md-secondary {
  justify-self: end; min-height: 41px; max-width: 100%; padding: 7px 10px; border-radius: 8px;
  font-size: 12px !important; font-weight: 750 !important; text-align: center; line-height: 1.2 !important;
}
.md-primary { border: 1px solid #dcbb7b; background:#f0c67b; color:#1e251b; }
.md-primary:hover:not(:disabled) { background:#ffda95; }
.md-primary:disabled, .md-secondary:disabled { background: #293936; border-color: #485b51; color: #bac5b9; }
.md-secondary { border: 1px solid #607467; background: #30423c; color: #eee9dc; }
.md-secondary:hover:not(:disabled) { background:#3c4f47; }
.md-tabs { display:flex; gap:6px; flex-wrap:wrap; margin: 14px 0 12px; }
.md-tab { min-height:36px; padding:6px 10px; border-radius:7px; background:#283a36; border:1px solid #4b6155; color:var(--md-muted); font-size:12px !important; }
.md-tab[aria-pressed="true"] { border-color:#e2b973; color:#ffe0a3; }
.md-hero-grid { display:grid; grid-template-columns: 1fr 1fr; gap: 13px; align-items:start; }
.md-hero-grid .md-scene { margin-bottom: 9px; }
.md-back { margin: 0 0 12px; justify-self: start; }
.md-business-head { display:flex; gap:10px; align-items:center; justify-content:space-between; margin-bottom: 10px; }
.md-business-head .md-section-title { margin-bottom: 3px !important; }
.md-total-income { min-width: fit-content; text-align:right; color: var(--md-gold); font-size: 14px; font-weight:750; font-variant-numeric: tabular-nums; }
.md-casino-grid { display:grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 10px; }
.md-casino-card {
  border: 1px solid #715649; padding: 15px; border-radius: 11px; min-height: 155px;
  background: radial-gradient(ellipse at 80% 0%, #713e3b, #382727 65%);
  display:grid; align-content:start; gap:9px; color:#ffedcd;
}
.md-casino-card.is-poker { background: radial-gradient(ellipse at 80% 0%, #3f6250, #252c28 70%); border-color:#5e7462; }
.md-casino-card h3 { font-size: 19px; font-weight: 780; }
.md-casino-card p { color: #ead3bb; font-size: 12px; }
.md-casino-card button { margin-top: 6px; justify-self: start; }
.md-stage-list { list-style: none; margin: 7px 0 0; padding: 0; display:grid; gap:3px; }
.md-stage-list li { color:var(--md-muted); padding:4px 6px; font-size:12px; border-radius:6px; }
.md-stage-list li[aria-current="step"] { background:#394738; color:#ffdb9b; font-weight:740; }
.md-poker-host, .md-royal-host { min-width:0; }
.md-load { padding: 25px 2px; color:var(--md-muted); }
@media (max-width: 710px) {
  .md-header { gap: 7px; padding-top: 14px; padding-bottom: 12px; }
  .md-main { padding-top: 13px; min-height: calc(100dvh - 180px); }
  .md-grid-home, .md-hero-grid { grid-template-columns: minmax(0,1fr); gap: 10px; }
  .md-grid-home .md-side { grid-template-columns: minmax(0,1fr); }
  .md-scene-top { inset: 8px auto auto 8px; font-size: 10px; }
  .md-caption { inset-inline: 9px; bottom: 8px; }
  .md-caption p { font-size: 10px; }
  .md-nav { flex-direction:column; gap:2px; font-size:11px !important; }
}
@media (max-width: 370px) {
  .md-brand h1 { font-size: 19px; }
  .md-wallet { font-size: 15px; }
  .md-head-right { gap: 5px; }
  .md-close { min-width: 37px; }
  .md-casino-grid { grid-template-columns: minmax(0,1fr); }
}
.magnat-poker {
  --mp-ink: #f8eddb;
  --mp-muted: #ccb9b4;
  --mp-brass: #d3a66a;
  --mp-plum: #301c2b;
  --mp-panel: #251923;
  display: grid;
  gap: 12px;
  width: min(100%, 540px);
  margin-inline: auto;
  color: var(--mp-ink);
}
.magnat-poker, .magnat-poker * { box-sizing: border-box; }
.magnat-poker .mp-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 10px;
  padding-block: 4px;
}
.magnat-poker .mp-header h1, .magnat-poker .mp-header h2 { margin: 0; font-size: clamp(1.12rem, 5vw, 1.55rem); }
.magnat-poker .mp-wallet { margin: 0; color: var(--mp-brass); font-weight: 700; font-variant-numeric: tabular-nums; }
.magnat-poker .mp-table {
  display: grid;
  gap: 10px;
  justify-items: center;
  padding: 15px 8px;
  background:
    repeating-linear-gradient(53deg, #ddfbec06 0 1px, transparent 1px 4px),
    radial-gradient(ellipse at 50% 48%, #285a51 0, #1d4a43 55%, #123430 100%);
  border: 5px solid #74513b;
  border-radius: 32px 32px 25px 25px;
  box-shadow: inset 0 0 0 1px #c8a16b, inset 0 5px 17px #081d1b9e, 0 4px #27191d, 0 9px 20px #110a1573;
}
.magnat-poker .mp-player {
  display: grid;
  justify-items: center;
  gap: 5px;
  color: #fbefdc;
  text-align: center;
}
.magnat-poker .mp-player > p, .magnat-poker .mp-board > p { margin: 0; }
.magnat-poker .mp-player-info { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 3px 9px; }
.magnat-poker .mp-player-info > span { color: #e4d4ba; font-variant-numeric: tabular-nums; }
.magnat-poker .mp-dealer { padding: 2px 5px; border-radius: 4px; color: #291a21; font-weight: 750; background: #f0cc8c; }
.magnat-poker .mp-bot, .magnat-poker .mp-hero { font-size: .87rem; }
.magnat-poker .mp-hero { color: #fff0c2; }
.magnat-poker .mp-cards {
  display: flex;
  justify-content: center;
  align-items: stretch;
  gap: 5px;
  min-width: 0;
}
.magnat-poker .mp-card {
  display: inline-grid;
  place-items: center;
  align-content: center;
  width: clamp(34px, 10vw, 52px);
  height: clamp(48px, 13vw, 68px);
  border: 1px solid #ccb89c;
  border-radius: 5px;
  color: #302834;
  background: linear-gradient(143deg, #fff9e8 10%, #ecdbbb 100%);
  box-shadow: 0 2px 0 #0d242192, inset 0 1px #fff;
  font-size: clamp(.85rem, 4vw, 1.12rem);
  font-weight: 780;
  font-variant-numeric: tabular-nums;
  line-height: 1;
}
.magnat-poker .mp-card.mp-red { color: #a32939; }
.magnat-poker .mp-card.mp-hidden {
  color: #ffe9bf;
  border-color: #ffdca888;
  background: repeating-linear-gradient(130deg, #815850 0 2px, #6a3f44 2px 4px);
  box-shadow: inset 0 0 0 3px #c09675, 0 2px 0 #0d242192;
}
.magnat-poker .mp-card.mp-empty {
  color: #f3e4b666;
  border: 1px dashed #edce8e57;
  background: #182e2a37;
  box-shadow: none;
}
.magnat-poker .mp-board { display: grid; justify-items: center; gap: 7px; min-width: 0; }
.magnat-poker .mp-bank, .magnat-poker .mp-street {
  text-align: center;
  color: #f4ddb0;
  font-size: .82rem;
  font-weight: 670;
  font-variant-numeric: tabular-nums;
}
.magnat-poker .mp-bank {
  padding: 3px 9px;
  border: 1px solid #e1bf795f;
  border-radius: 999px;
  background: #112420a8;
}
.magnat-poker .mp-log, .magnat-poker .mp-status {
  color: var(--mp-muted);
  margin: 0;
  font-size: .86rem;
  line-height: 1.4;
}
.magnat-poker .mp-log { display: grid; gap: 3px; padding: 0; list-style: none; text-align: center; }
.magnat-poker .mp-log:empty { display: none; }
.magnat-poker .mp-status { color: var(--mp-ink); }
.magnat-poker .mp-controls, .magnat-poker .mp-bet, .magnat-poker .mp-stakes {
  display: flex;
  gap: 7px;
  align-items: center;
  flex-wrap: wrap;
}
.magnat-poker .mp-action-row { display: grid; grid-template-columns: 1fr 1.4fr; gap: 7px; width: 100%; }
.magnat-poker .mp-controls > .mp-bet { display: grid; grid-template-columns: minmax(0, 1fr) auto; width: 100%; }
.magnat-poker .mp-bet-label { display: block; width: 100%; padding: 4px 0; color: #ecdec9; font-size: .84rem; }
.magnat-poker .mp-bet input { display: block; width: 100%; min-height: 24px; margin: 1px 0; accent-color: #d9aa6b; }
.magnat-poker .mp-bet output { font-weight: 750; font-variant-numeric: tabular-nums; }
.magnat-poker .mp-stake-label { display: grid; gap: 5px; flex: 1 1 10rem; min-width: 0; color: var(--mp-muted); font-size: .80rem; }
.magnat-poker .mp-stake-label select { width: 100%; }
.magnat-poker .mp-stakes { align-items: end; }
.magnat-poker .mp-stakes .mp-status { flex-basis: 100%; }
.magnat-poker button, .magnat-poker select {
  min-height: 43px;
  padding: 8px 11px;
  border: 1px solid #956352;
  border-radius: 6px;
  background: linear-gradient(#482c3c, #301e2d);
  color: var(--mp-ink);
  font: inherit;
  font-size: .86rem;
}
.magnat-poker select { color-scheme: dark; }
.magnat-poker button { cursor: pointer; touch-action: manipulation; }
.magnat-poker button:hover:not(:disabled) { border-color: #edbe78; }
.magnat-poker button:disabled { opacity: .55; cursor: default; }
.magnat-poker .mp-primary {
  border-color: #f1c88a;
  color: #30192a;
  background: linear-gradient(#ebc88f, #c88b52);
  font-weight: 750;
}
.magnat-poker :is(button, select, input, summary):focus-visible { outline: 2px solid #ffe1a0; outline-offset: 3px; }
.magnat-poker .mp-rules {
  color: var(--mp-muted);
  padding: 9px 10px;
  border: 1px solid #765047;
  border-radius: 6px;
  background: var(--mp-panel);
  font-size: .83rem;
  line-height: 1.45;
}
.magnat-poker .mp-rules summary { cursor: pointer; color: #eec994; }
.magnat-poker .mp-rules p { margin: 7px 0 0; }

.md-wallet [data-md-wallet] { white-space: nowrap; }
.md-scene { aspect-ratio: 16/9; }
.md-scene .md-scene-photo { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.md-scene::after { inset: 37% 0 0; background: linear-gradient(transparent, #101718e8); }
.md-portrait {
  position: absolute; z-index: 1; right: clamp(9px, 4%, 22px); bottom: 6%;
  width: 27%; height: 74%; pointer-events: none;
  filter: saturate(.88) drop-shadow(2px 4px 5px #11191bb3);
}
.md-hero-grid .md-portrait { right: clamp(9px, 4%, 18px); width: 31%; height: 85%; }
.md-portrait canvas { display: block; width: 100%; height: 100%; object-fit: contain; }
.md-caption { padding-right: min(34%, 165px); }
.md-caption p { color: #e0e4d8; }
.md-possessions { margin-top: 8px !important; color: var(--md-muted); font-size: 12px; }
.md-owned { margin: 13px 0; }
.md-owned-heading { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.md-owned-heading .md-section-title { font-size: 17px; }
.md-owned-list {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(110px, 28%);
  gap: 8px; padding-bottom: 5px; overflow-x: auto; overscroll-behavior-inline: contain;
  scroll-snap-type: x proximity; scrollbar-color: #647967 #202e2e; scrollbar-width: thin;
}
.md-owned-tile {
  display: flex; flex-direction: column; align-items: stretch; padding: 0 0 7px;
  scroll-snap-align: start; min-width: 0; border: 1px solid var(--md-line); border-radius: 8px;
  background: var(--md-panel); color: var(--md-text); text-align: left; overflow: hidden;
}
.md-owned-tile:hover { border-color: #a78f62; }
.md-owned-tile:focus-visible { outline-offset: -2px; }
.md-owned-photo { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; }
.md-owned-tile strong, .md-owned-tile span { padding: 0 6px; }
.md-owned-tile strong { margin-top: 4px; font-size: 11px; white-space: nowrap; text-overflow: ellipsis; overflow: hidden; }
.md-owned-tile span { color: var(--md-green); font-size: 10px; font-variant-numeric: tabular-nums; white-space: nowrap; }
.md-current-shift { margin-top: 10px; }
.md-early-jobs { margin-top: 11px; }
.md-early-jobs[open] .md-job-list { margin-top: 9px; }
.md-business-list { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; }
.md-business-card, .md-home-card, .md-car-card { min-width: 0; overflow: hidden; border: 1px solid var(--md-line); border-radius: 11px; background: var(--md-panel); }
.md-business-photo, .md-home-photo, .md-car-photo { display: block; width: 100%; aspect-ratio: 16/7; object-fit: cover; border-bottom: 1px solid var(--md-line); }
.md-business-photo { aspect-ratio: 16/9; }
.md-business-card .md-row, .md-home-card .md-row, .md-car-card .md-row { min-height: 96px; border: 0; border-radius: 0; background: transparent; }
.md-business-card .md-primary { white-space: nowrap; }
.md-car-photo { aspect-ratio: 2/1; }
.md-row-with-thumb { grid-template-columns: clamp(43px, 13vw, 58px) minmax(0,1fr) auto; }
.md-item-thumb {
  display: block; width: 100%; aspect-ratio: 1; padding: 5px;
  border: 1px solid #62796d52; border-radius: 8px; background: #536c663b;
  object-fit: contain;
}
@media (max-width: 710px) {
  .md-business-list { grid-template-columns: minmax(0,1fr); }
}
@media (max-width: 370px) {
  .md-business-card .md-row { grid-template-columns: minmax(0,1fr); }
  .md-business-card .md-primary { justify-self: start; }
}

.md-tap {
  --md-tap-accent: #f4ca78;
  display: grid; gap: 12px; margin: 13px 0;
  min-width: 0; overflow: hidden;
  background: radial-gradient(ellipse at 50% 40%, #3b4634 0%, #26372f 46%, #202e2e 76%);
}
.md-tap-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 3px 10px; }
.md-tap-head h2 { font-size: 17px; font-weight: 780; letter-spacing: -.02em; }
.md-tap-head p { color: var(--md-muted); font-size: 12px; }
.md-tap-head strong { color: var(--md-tap-accent); font-weight: 800; white-space: nowrap; font-variant-numeric: tabular-nums; }
.md-tap-field {
  position: relative; display: grid; place-items: center; isolation: isolate;
  min-height: 152px; padding: 7px 0 12px;
}
.md-tap-coin {
  position: relative; display: grid; place-items: center;
  width: 128px; aspect-ratio: 1; padding: 0; border: 1px solid #f9d78b;
  border-radius: 50%; -webkit-tap-highlight-color: transparent; user-select: none; touch-action: manipulation;
  background: repeating-conic-gradient(from 0deg, #b7833b 0 2deg, #f8cf76 2deg 3deg, #dbab5c 3deg 5deg);
  color: #704321;
  box-shadow: 0 5px 0 #9c662e, 0 7px 0 #654221, 0 14px 28px #111b19ba, 0 0 28px #efc66b20;
  transition: transform .13s ease, box-shadow .13s ease, filter .15s ease;
}
.md-tap-coin::before {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  border: 1px solid #a87539;
  background:
    repeating-conic-gradient(from 5deg, #ffe3a727 0 .4deg, #62411a12 .4deg .8deg, transparent .8deg 1.9deg),
    radial-gradient(circle at 37% 31%, #ffe7a5 0%, #efc470 52%, #cb9350 83%, #a56a36);
  box-shadow: inset 0 0 0 2px #efcc82, inset 0 0 0 3px #a7733b, inset 0 0 12px #9d602f78;
}
.md-tap-coin span {
  position: relative;
  font: 800 62px/1 system-ui, sans-serif;
  text-shadow: 0 1px 0 #ffeba9, 0 -1px 0 #704923;
}
.md-tap-coin:hover:not([aria-disabled="true"]) { filter: brightness(1.08); }
.md-tap-coin:active:not([aria-disabled="true"]) {
  transform: translateY(3px) scale(.96);
  box-shadow: 0 2px 0 #976228, 0 3px 0 #654221, 0 7px 18px #111b19ba;
}
.md-tap-coin[aria-disabled="true"] { filter: saturate(.43) brightness(.87); cursor: default; }
.md-tap-coin:focus-visible { outline-offset: 5px; }
.md-tap-particles { position: absolute; inset: 0; z-index: 1; pointer-events: none; }
.md-tap-particles span {
  position: absolute; white-space: nowrap; color: #fff0ad;
  text-shadow: 0 1px 2px #2d1b0c, 0 2px 7px #0d1715;
  font-size: 17px; font-weight: 850; font-variant-numeric: tabular-nums;
  animation: md-tap-float .75s cubic-bezier(.15,.5,.39,1) both;
}
@keyframes md-tap-float {
  0% { opacity: 0; transform: translate(-50%, -35%) scale(.84); }
  15%, 45% { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--md-tap-drift)), -80px) scale(1.08); }
}
.md-tap-energy { display: grid; gap: 5px; }
.md-tap-energy > div { display: flex; justify-content: space-between; gap: 6px; color: var(--md-muted); font-size: 12px; }
.md-tap-energy strong { color: var(--md-text); font-variant-numeric: tabular-nums; }
.md-tap-meter { display: block; height: 7px; }
.md-tap-meter::-webkit-progress-value { background: linear-gradient(90deg, #bf923c, #ffe0a1); }
.md-tap-meter::-moz-progress-bar { background: linear-gradient(90deg, #bf923c, #ffe0a1); }
.md-tap-recovery { color: var(--md-muted); font-size: 11px; }
.md-tap-upgrades { border-top: 1px solid var(--md-line); }
.md-tap-upgrades summary {
  min-height: 36px; padding: 9px 1px 3px; color: #f3daa1; cursor: pointer;
  font-size: 13px; font-weight: 760; touch-action: manipulation;
}
.md-tap-upgrade-list { display: grid; gap: 7px; padding-top: 4px; }
.md-tap-upgrade {
  display: grid; grid-template-columns: minmax(0,1fr) auto; align-items: center;
  gap: 7px; border: 1px solid var(--md-line); border-radius: 8px; padding: 8px;
  background: #233230;
}
.md-tap-upgrade h3 { font-size: 13px; font-weight: 760; }
.md-tap-upgrade p { color: var(--md-muted); font-size: 11px; }
.md-tap-upgrade [data-md-tap-level] { display: block; margin-top: 2px; color: var(--md-green); font-size: 11px; }
.md-tap-upgrade-price { min-height: 38px; padding-inline: 8px; white-space: nowrap; }
@media (prefers-reduced-motion: reduce) {
  .md-tap-coin { transition: none; }
  .md-tap-coin:active:not([aria-disabled="true"]) { transform: none; }
  .md-tap-particles span { transform: translate(-50%, -50%); animation: md-tap-fade .48s ease-out both; }
}
@keyframes md-tap-fade {
  0%, 40% { opacity: 1; }
  100% { opacity: 0; }
}

.md-chapter {
  display: grid;
  gap: 11px;
  margin: 11px 0;
  padding: 13px;
  border: 1px solid #78674b;
  border-radius: 12px;
  background: linear-gradient(155deg, #3b3025, #292b25 74%);
  color: #f0e9da;
}
.md-chapter-head, .md-chapter-objective {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 9px 12px;
}
.md-chapter-head h2 {
  color: #fff0d2;
  font-size: clamp(18px, 3.9vw, 22px);
  line-height: 1.12;
  font-weight: 790;
  letter-spacing: -.025em;
}
.md-chapter-number {
  color: #e9c389;
  font-size: 11px;
  font-weight: 720;
  margin-bottom: 3px !important;
}
.md-chapter-progress {
  flex: 0 0 53px;
  display: grid;
  gap: 4px;
  text-align: right;
  color: #ffdb9b;
  font-size: 13px;
  line-height: 1;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
}
.md-chapter-progress progress {
  display: block;
  width: 100%;
  height: 5px;
  border: 0;
  border-radius: 4px;
  appearance: none;
  background: #2a241d;
}
.md-chapter-progress progress::-webkit-progress-bar { background: #574633; border-radius: 4px; }
.md-chapter-progress progress::-webkit-progress-value { background: #deb26a; border-radius: 4px; }
.md-chapter-progress progress::-moz-progress-bar { background: #deb26a; border-radius: 4px; }
.md-chapter-dialogue {
  border-left: 2px solid #aa8150;
  padding: 1px 0 1px 9px;
}
.md-chapter-lines {
  display: grid;
  gap: 5px;
  margin: 0;
  line-height: 1.36;
  font-size: 12px;
}
.md-chapter-lines dt {
  display: inline;
  color: #f0c98b;
  font-weight: 740;
  margin-right: 5px;
}
.md-chapter-lines dd { display: inline; margin: 0; color: #e9e1d2; }
.md-chapter-objective {
  flex-wrap: wrap;
  border-top: 1px solid #cfa56c35;
  padding-top: 10px;
}
.md-chapter-objective > div { flex: 1 1 120px; min-width: 0; }
.md-chapter-objective button { flex: 0 0 auto; min-height: 44px; }
.md-chapter-goal { color: #fff1d6; font-size: 13px; font-weight: 740; }
.md-chapter [data-md-chapter-hint] { color: #d8c6a7; font-size: 11px; margin-top: 3px; }
.md-chapter-final { color: #c8d8ad; font-size: 13px; }
.md-chapter-journal {
  min-width: 0;
  border-top: 1px solid #cfa56c35;
}
.md-chapter-journal summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  min-height: 40px;
  padding: 5px 2px 1px;
  list-style: none;
  cursor: pointer;
  color: #f5d898;
  font-size: 13px;
  font-weight: 700;
}
.md-chapter-journal summary::-webkit-details-marker { display: none; }
.md-chapter-journal summary::after {
  content: '';
  width: 7px;
  height: 7px;
  margin-right: 4px;
  border-right: 1px solid currentColor;
  border-bottom: 1px solid currentColor;
  transform: translateY(-2px) rotate(45deg);
}
.md-chapter-journal[open] summary::after { transform: translateY(2px) rotate(225deg); }
.md-chapter-records { display: grid; gap: 10px; }
.md-chapter-checklist {
  display: grid;
  gap: 3px;
  padding: 0;
  margin: 0;
  list-style: none;
}
.md-chapter-checklist li {
  display: grid;
  grid-template-columns: 17px minmax(0,1fr) auto;
  align-items: center;
  gap: 5px;
  padding: 4px 5px;
  color: #decfb8;
  font-size: 12px;
  line-height: 1.3;
}
.md-chapter-check { text-align: center; font-weight: 770; color: #d7ac6b; }
.md-chapter-checklist li[data-done="true"] .md-chapter-check { color: #c2d5a0; }
.md-chapter-checklist li[aria-current="step"] { border-radius: 5px; background: #664f374f; color: #fff0d2; }
.md-chapter-checklist small { color: #e0ccaa; font-size: 10px; }
.md-chapter-scenes {
  display: grid;
  gap: 8px;
}
.md-chapter-scenes > section {
  min-width: 0;
  border-top: 1px solid #cfa56c30;
  padding-top: 7px;
}
.md-chapter-scenes h3 { color: #f7dfb1; font-size: 12px; margin-bottom: 4px; }

@media (max-width: 375px) {
  .md-chapter { padding: 10px; gap: 9px; }
  .md-chapter-objective { gap: 7px 8px; }
}

.md-settings-open,
.md-settings-close {
  display: grid;
  place-items: center;
  width: 42px;
  min-width: 42px;
  height: 42px;
  padding: 0;
  color: #f2e4c8;
  background: #283b36;
  border: 1px solid #607467;
  border-radius: 8px;
  font-size: 23px !important;
  line-height: 1;
}
.md-settings-open:hover,
.md-settings-close:hover:not(:disabled) { background: #354a42; }
.md-settings-close:disabled { opacity: .5; }
.md-settings-dialog {
  box-sizing: border-box;
  width: min(440px, calc(100vw - 24px));
  max-height: min(580px, calc(100dvh - 32px));
  padding: 0;
  margin: auto;
  overflow: auto;
  overscroll-behavior: contain;
  border: 1px solid #718074;
  border-radius: 15px;
  box-shadow: 0 18px 65px #090d0caa;
  color: #f2ede2;
  background: linear-gradient(146deg, #30423b, #202e2c 57%);
  font: inherit;
  color-scheme: dark;
}
.md-settings-dialog::backdrop { background: #0c1514c9; }
.md-settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 13px 15px;
  border-bottom: 1px solid #53695b;
}
.md-settings-header h2 {
  color: #fff1d2;
  font-size: 20px;
  font-weight: 770;
  line-height: 1.18;
  letter-spacing: -.015em;
}
.md-settings-body { display: grid; gap: 15px; padding: 14px 15px 16px; }
.md-settings-sound { display: grid; gap: 10px; }
.md-settings-option,
.md-settings-level {
  display: flex;
  min-height: 43px;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  color: #f1eadc;
  font-size: 14px;
  font-weight: 680;
}
.md-settings-option { cursor: pointer; }
.md-settings-option input {
  -webkit-appearance: none;
  appearance: none;
  flex: 0 0 43px;
  width: 43px;
  height: 25px;
  margin: 0;
  border: 1px solid #7e9386;
  border-radius: 16px;
  background: radial-gradient(circle, #e7e8dd 0 7px, transparent 7.7px) 3px center / 16px 16px no-repeat #1c2b29;
  cursor: pointer;
}
.md-settings-option input:checked {
  border-color: #c7d89c;
  background: radial-gradient(circle, #eef1db 0 7px, transparent 7.7px) right 3px center / 16px 16px no-repeat #567250;
}
.md-settings-dialog input:focus-visible { outline: 2px solid #f6d18d; outline-offset: 3px; }
.md-settings-level { flex-wrap: wrap; }
.md-settings-level output { color: #f0c67b; font-variant-numeric: tabular-nums; }
.md-settings-level input {
  flex: 0 0 100%;
  min-width: 0;
  height: 30px;
  margin: -4px 0 0;
  accent-color: #f0c67b;
  cursor: pointer;
}
.md-settings-test { justify-self: start; }
.md-settings-reset {
  display: grid;
  gap: 8px;
  padding-top: 13px;
  border-top: 1px solid #53695b;
}
.md-settings-reset h3 { font-size: 14px; font-weight: 730; }
.md-settings-danger {
  justify-self: start;
  min-height: 42px;
  max-width: 100%;
  padding: 8px 11px;
  border: 1px solid #ad7771;
  border-radius: 8px;
  background: #613538;
  color: #ffe3d7;
  line-height: 1.22;
  text-align: center;
  font-size: 13px !important;
  font-weight: 740 !important;
}
.md-settings-danger:hover:not(:disabled) { background: #754449; }
.md-settings-danger:disabled { opacity: .55; }
.md-settings-warning,
.md-settings-error { font-size: 13px; line-height: 1.45; overflow-wrap: anywhere; }
.md-settings-warning { color: #e8dac6; }
.md-settings-error { color: #ffbba7; }
.md-settings-confirm-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.md-settings-confirm-actions button { min-height: 44px; }
@media (max-width: 375px) {
  .md-settings-open { width: 37px; min-width: 37px; }
  .md-settings-header, .md-settings-body { padding-inline: 12px; }
}

.md-shop-locked {
  display: grid;
  grid-template-columns: clamp(43px, 13vw, 58px) minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  min-width: 0;
  padding: 10px;
  border: 1px solid #424642;
  border-radius: 10px;
  background: #1a1f1d;
  color: #e1e4dd;
}
.md-shop-locked-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #353935;
  border-radius: 7px;
  background: radial-gradient(ellipse at 50% 38%, #232722, #111412 85%);
  color: #bbb9a8;
  font-size: clamp(26px, 8vw, 35px);
  font-weight: 750;
  line-height: 1;
}
.md-shop-locked-copy { min-width: 0; }
.md-shop-locked-copy h3 {
  font-size: 14px;
  line-height: 1.2;
  font-weight: 750;
}
.md-shop-locked-copy p {
  margin-top: 4px;
  color: #c0c5bb;
  font-size: 12px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}
.md-shop-locked-car {
  grid-template-columns: minmax(0, 1fr);
  overflow: hidden;
  gap: 0;
  padding: 0;
}
.md-shop-locked-car .md-shop-locked-preview {
  aspect-ratio: 2 / 1;
  border: 0;
  border-bottom: 1px solid #3f433d;
  border-radius: 0;
  font-size: clamp(42px, 10vw, 64px);
}
.md-shop-locked-car .md-shop-locked-copy { padding: 11px; }
.md-shop-locked[data-md-locked-category="home"] .md-shop-locked-preview { aspect-ratio: 16 / 7; }

.md-chapter { scroll-margin-block-start: 12px; }
.md-chapter:focus-visible { outline: 2px solid #f6d18d; outline-offset: 3px; }
.md-chapter-choices {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: 8px;
  width: 100%;
}
.md-chapter-choice {
  display: grid;
  grid-template-rows: auto 1fr auto;
  gap: 5px;
  min-width: 0;
  padding: 9px;
  border: 1px solid #7a6646;
  border-radius: 8px;
  background: #3c352a;
}
.md-chapter-choice h3 {
  color: #fff0d2;
  font-size: 13px;
  line-height: 1.3;
}
.md-chapter-choice p {
  color: #dfd0b7;
  font-size: 12px;
  line-height: 1.36;
  overflow-wrap: anywhere;
}
.md-chapter-choice button {
  justify-self: start;
  margin-top: 2px;
}
.md-chapter-archives { display: grid; gap: 6px; margin-top: 8px; }
.md-chapter-archive {
  padding: 0 8px;
  border: 1px solid #cfa56c35;
  border-radius: 7px;
  background: #211f1b4d;
}
.md-chapter-archive[open] { padding-bottom: 8px; }
.md-chapter-journal[open] .md-chapter-archive > summary::after {
  transform: translateY(-2px) rotate(45deg);
}
.md-chapter-journal[open] .md-chapter-archive[open] > summary::after {
  transform: translateY(2px) rotate(225deg);
}
.md-chapter-archive-badge {
  margin-inline-start: auto;
  color: #c6d8aa;
  font-size: 11px;
  font-weight: 650;
  white-space: nowrap;
}
.md-chapter-archive .md-chapter-scenes { margin-top: 5px; }
.md-business-story-preview {
  display: grid;
  place-items: center;
  width: 100%;
  aspect-ratio: 16 / 9;
  border-bottom: 1px solid #414641;
  background: radial-gradient(ellipse at 50% 38%, #212724, #111412 80%);
  color: #c2bfac;
  font-size: clamp(42px, 11vw, 70px);
  font-weight: 760;
  line-height: 1;
}
.md-business-story-gate {
  margin-top: 5px;
  color: #efce91 !important;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.md-tap-upgrade[data-md-tap-locked] {
  grid-template-columns: clamp(30px, 9vw, 43px) minmax(0, 1fr) auto;
  border-color: #424642;
  background: #1a1f1d;
}
.md-tap-lock-preview {
  display: grid;
  place-items: center;
  aspect-ratio: 1;
  border: 1px solid #353935;
  border-radius: 7px;
  background: #101411;
  color: #bbb9a8;
  font-size: 24px;
  font-weight: 750;
  line-height: 1;
}
.md-tap-upgrade[data-md-tap-locked] [data-md-tap-upgrade-hint] {
  color: #c7cabb;
  overflow-wrap: anywhere;
}
.md-upgrade-locked:disabled {
  border-color: #51574f;
  background: #131714;
  color: #d4d3c8;
}

.md-unlock-notice {
  position: fixed;
  z-index: 6;
  inset-inline-end: max(12px, env(safe-area-inset-right), calc((100% - 1080px) / 2 + 18px));
  bottom: calc(69px + max(8px, env(safe-area-inset-bottom)));
  width: min(388px, calc(100% - 24px));
  padding: 8px;
  border: 1px solid #a18a5c;
  border-radius: 13px;
  background: #223331;
  color: var(--md-text);
  box-shadow: 0 8px 24px #0c1515b3;
  animation: md-unlock-enter 180ms ease-out;
}

.md-unlock-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  padding-inline-start: 6px;
}

.md-unlock-heading h2 {
  color: var(--md-gold);
  font-size: 14px;
  font-weight: 780;
  line-height: 1.2;
}

.md-unlock-dismiss {
  display: grid;
  flex: none;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid transparent;
  border-radius: 8px;
  background: transparent;
  color: var(--md-text);
  font-size: 22px !important;
  line-height: 1;
}

.md-unlock-dismiss:hover { background: #354941; }

.md-unlock-list {
  display: grid;
  gap: 4px;
  max-height: min(214px, 32dvh);
  margin: 0;
  padding: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-color: #7c8a76 #223331;
  list-style: none;
}

.md-unlock-link {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 49px;
  padding: 7px 10px;
  border: 1px solid #576d5d;
  border-radius: 8px;
  background: #2d423b;
  color: var(--md-text);
  text-align: start;
}

.md-unlock-link:hover { background: #354b41; }
.md-unlock-link strong, .md-unlock-link small { display: block; overflow-wrap: anywhere; }
.md-unlock-link strong { font-size: 14px; line-height: 1.2; }
.md-unlock-link small { margin-top: 2px; color: var(--md-muted); font-size: 11px; line-height: 1.3; }
.md-unlock-link > [aria-hidden="true"] { color: var(--md-gold); font-size: 18px; }
.md-root .md-unlock-link:focus-visible { outline-offset: -3px; }

.md-unlock-live {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

@keyframes md-unlock-enter {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

@media (prefers-reduced-motion: reduce) {
  .md-unlock-notice { animation: none; }
}

.md-stat-list { gap: 2px; }
.md-stat-list li { grid-template-columns: 112px minmax(0, 1fr) 24px; }
.md-stat-label { display: flex; align-items: center; gap: 2px; }
.md-stat-help {
  display: grid; place-items: center; width: 30px; min-width: 30px; height: 30px; margin: 0;
  padding: 0; border: 0; border-radius: 7px; background: transparent; color: var(--md-gold);
}
.md-stat-help span {
  display: grid; place-items: center; width: 18px; height: 18px;
  border: 1px solid #8d805e; border-radius: 50%; font-size: 11px; line-height: 1;
}
.md-stat-help:hover span, .md-stat-help[aria-expanded="true"] span { background: #45513e; border-color: var(--md-gold); }
.md-stat-list .md-stat-explanation {
  grid-column: 1 / -1; margin: 0 0 5px; padding: 7px 9px;
  border-inline-start: 2px solid #af935c; border-radius: 4px; background: #192726;
  color: var(--md-text); font-size: 12px; line-height: 1.4;
}

@media (max-width: 350px) {
  .md-stat-list li { grid-template-columns: 100px minmax(24px, 1fr) 24px; column-gap: 5px; }
}

.md-club-card { grid-column: 1 / -1; min-width: 0; }
.md-club-photo-wrap { min-width: 0; }
.md-club-photo-wrap img { object-position: center 48%; }
.md-club-body { min-width: 0; padding: 15px; }
.md-club-body h3 { font-size: 20px; font-weight: 790; line-height: 1.17; }
.md-club-body .md-club-description { margin-top: 5px; color: var(--md-muted); font-size: 13px; }
.md-club-body .md-club-income { margin-top: 8px; color: var(--md-gold); font-size: 14px; font-weight: 750; }
.md-club-body .md-business-story-gate { margin-top: 8px; }
.md-club-controls, .md-club-services { display: flex; flex-wrap: wrap; gap: 6px; }
.md-club-controls { margin-top: 10px; }
.md-club-services { margin: 8px 0 0; padding: 0; list-style: none; }
.md-club-services li { padding: 3px 7px; border: 1px solid #536959; border-radius: 6px; color: var(--md-green); font-size: 11px; }
.md-club-body .md-club-next { margin-top: 9px; color: var(--md-muted); font-size: 12px; }
.md-club-roadmap { margin-top: 8px; color: var(--md-muted); font-size: 12px; }
.md-club-roadmap summary { min-height: 32px; padding: 7px 0; color: var(--md-text); cursor: pointer; }
.md-club-roadmap ol { display: grid; gap: 2px; margin: 1px 0 0; padding: 0; list-style: none; }
.md-club-roadmap li { display: grid; grid-template-columns: 48px minmax(0, 1fr); gap: 5px; }
.md-club-roadmap li.md-club-reached { color: var(--md-green); }
.md-club-roadmap li[aria-current="step"] { font-weight: 740; color: var(--md-gold); }
.md-club-casino-link { margin-bottom: 11px; }

@media (min-width: 721px) {
  .md-club-card { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); }
  .md-club-photo-wrap img { height: 100%; border: 0; }
  .md-club-body { padding: 17px; }
}

.md-hall-winnings { margin-block: 7px; }
.md-hall-winnings p { margin: 0 0 4px; }
.md-hall-winnings .md-meter { display: block; }
.md-casino-card .md-hall-winnings { margin-block: 0; }
.md-casino-card .md-hall-target-done { color: var(--md-green); }

.md-hall-goals { display: grid; gap: 9px; margin: 0; padding: 0; list-style: none; }
.md-hall-goals li > div { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 3px 9px; }
.md-hall-goals li > div > span { color: var(--md-muted); font-size: 12px; }
.md-hall-goals strong { color: var(--md-text); font-size: 12px; font-weight: 650; font-variant-numeric: tabular-nums; }
.md-hall-goals li[data-done="true"] strong, .md-hall-check { color: var(--md-green); }
.md-hall-goals .md-meter { margin-top: 4px; }

:host(.cm-royal-surface) .controls { grid-template-columns: minmax(0, 1fr) 48px; }
:host(.cm-royal-surface) .bet-controls {
  grid-column: 1 / -1;
  grid-template-columns: 40px minmax(0, 1fr) 40px 56px;
  gap: 6px;
}
:host(.cm-royal-surface) .bet-input {
  width: 100%; min-width: 0; min-height: 46px; padding: 7px 8px;
  border: 1px solid #b78150; border-radius: 8px;
  background: #241c22; color: #ffe9c5;
  font: 650 16px/1.2 system-ui, sans-serif; font-variant-numeric: tabular-nums;
  text-align: center;
}
:host(.cm-royal-surface) .bet-input:disabled { color: #a89488; }
:host(.cm-royal-surface) .bet-input:focus-visible { outline: 2px solid #ffdb94; outline-offset: 2px; }
:host(.cm-royal-surface) .key.bet-max { font-size: 14px; }

.md-intro {
  width: min(860px, 100vw);
  max-width: 100vw;
  height: min(760px, 100dvh);
  max-height: 100dvh;
  padding: 0;
  margin: auto;
  overflow: hidden;
  border: 1px solid #46534b;
  border-radius: 15px;
  background: #0d1513;
  color: #f2ede2;
  font: inherit;
  color-scheme: dark;
}
.md-intro::backdrop { background: #060b09ed; }
.md-intro-screen { position: relative; isolation: isolate; width: 100%; height: 100%; display: flex; flex-direction: column; }
.md-intro-images, .md-intro-shade { position: absolute; inset: 0; z-index: -1; overflow: hidden; }
.md-intro-image { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center; opacity: 0; transform: scale(1.03); transition: opacity .55s ease; }
.md-intro-image.is-visible { opacity: 1; animation: md-intro-pan 6s linear both; }
.md-intro[data-paused="true"] .md-intro-image { animation-play-state: paused; }
.md-intro-shade { background: linear-gradient(#08100b85, transparent 27%, #09120eb0 52%, #09120ef0 79%, #09120e); }
.md-intro-header { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: max(14px, env(safe-area-inset-top)) 18px 0; }
.md-intro-brand { font-size: 13px; font-weight: 750; letter-spacing: .015em; text-shadow: 0 1px 5px #000; }
.md-intro button { font: inherit; cursor: pointer; touch-action: manipulation; }
.md-intro button:focus-visible { outline: 2px solid #f0c67b; outline-offset: 3px; }
.md-intro-skip { min-height: 40px; padding: 7px 10px; border: 1px solid #bbc4ad75; border-radius: 7px; color: #f5efdf; background: #111e17aa; font-size: 12px !important; }
.md-intro-caption { width: min(100%, 650px); margin: auto 0 0; padding: 28px 25px 17px; }
.md-intro-caption h2 { margin: 0; font-size: clamp(25px, 5vw, 42px); font-weight: 790; line-height: 1.08; color: #f7e3b6; text-wrap: balance; }
.md-intro-caption p { margin: 12px 0 0; color: #eeeade; font-size: clamp(15px, 2.8vw, 19px); line-height: 1.45; text-shadow: 0 1px 4px #000; }
.md-intro-footer { padding: 0 25px max(20px, env(safe-area-inset-bottom)); }
.md-intro-progress { display: grid; grid-auto-flow: column; grid-auto-columns: 1fr; gap: 5px; margin: 0 0 14px; padding: 0; list-style: none; }
.md-intro-progress li { height: 3px; overflow: hidden; border-radius: 4px; background: #b9c3b740; }
.md-intro-progress li span { display: block; width: 100%; height: 100%; transform: scaleX(0); transform-origin: left; background: #e7bf77; }
.md-intro-controls { display: grid; grid-template-columns: 40px auto minmax(30px, 1fr) auto; gap: 6px; align-items: center; }
.md-intro-control, .md-intro-next { min-height: 43px; padding: 8px 11px; border: 1px solid #728272; border-radius: 8px; }
.md-intro-control { color: #eee8d8; background: #24372cbf; font-size: 12px !important; }
.md-intro-control:disabled { opacity: .35; cursor: default; }
.md-intro-next { color: #172218; background: #e9c17b; border-color: #f5d49b; font-size: 12px !important; font-weight: 760 !important; }
.md-intro-counter { color: #c3cec0; font-size: 11px; text-align: center; font-variant-numeric: tabular-nums; }
@keyframes md-intro-pan { from { transform: scale(1.03); } to { transform: scale(1.10); } }
@media (max-width: 600px) {
  .md-intro { height: 100dvh; border: 0; border-radius: 0; }
  .md-intro-header { padding-inline: 14px; }
  .md-intro-caption { padding: 26px 18px 18px; }
  .md-intro-footer { padding-inline: 18px; }
}
@media (max-width: 350px) {
  .md-intro-controls { grid-template-columns: 34px auto minmax(22px, 1fr) auto; gap: 4px; }
  .md-intro-control, .md-intro-next { padding-inline: 8px; }
}
@media (max-height: 440px) and (orientation: landscape) {
  .md-intro { width: 100vw; height: 100dvh; border: 0; border-radius: 0; }
  .md-intro-header { padding-top: 6px; }
  .md-intro-caption { padding-block: 8px; }
  .md-intro-caption h2 { font-size: 24px; }
  .md-intro-caption p { margin-top: 6px; font-size: 14px; }
  .md-intro-footer { padding-bottom: 8px; }
  .md-intro-progress { margin-bottom: 7px; }
}
@media (prefers-reduced-motion: reduce) {
  .md-intro-image, .md-intro-image.is-visible { animation: none; transition: none; transform: none; }
}

.md-purchase-replays { margin-block: 7px 12px; }
.md-purchase-replays summary { min-height: 38px; padding-block: 9px; color: var(--md-text); cursor: pointer; }
[data-md-purchase-list] { display: grid; gap: 5px; padding-top: 4px; }
[data-md-purchase-list] .md-settings-replay { margin: 0; text-align: start; }

.md-current-shift.md-panel {
  padding: 0;
  overflow: hidden;
}
.md-work-image-wrap {
  position: relative;
  aspect-ratio: 3 / 2;
  overflow: hidden;
  background: #192422;
}
.md-work-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.035);
  transition: opacity .65s ease;
}
.md-work-image.is-visible {
  opacity: 1;
  animation: md-work-camera 13s ease-in-out infinite alternate;
}
.md-work-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(#0d181c19 50%, #122120b8);
  pointer-events: none;
}
.md-work-on-scene {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 6px 10px;
  border-radius: 7px;
  background: #172725de;
  color: #f0e9dc;
  font-size: 12px;
  font-weight: 650;
}
.md-work-details {
  display: grid;
  gap: 9px;
  padding: 16px 18px;
}
.md-work-details .md-shift-title {
  color: #f4e7cf;
  font-size: 18px;
  line-height: 1.3;
  margin: 0;
}
.md-work-details .md-work-phase {
  color: #bed0c2;
  font-size: 14px;
  line-height: 1.4;
  margin: 0;
  min-height: 1.4em;
}
.md-work-steps {
  display: flex;
  gap: 6px;
  list-style: none;
  padding: 0;
  margin: 3px 0 0;
}
.md-work-steps li {
  flex: 1;
  height: 4px;
  border-radius: 4px;
  background: #172725;
  transition: background .4s;
}
.md-work-steps li[data-complete="true"] { background: #91ad8d; }
.md-work-steps li[aria-current="step"] { background: #efc773; }
.md-work-step-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
}
.md-work-details .md-meter { width: 100%; margin: 0; }
.md-work-details .md-work-time { color: #a9bfb2; font-size: 13px; margin: 0; }
.md-work-paid {
  color: #f2ce85;
  font-size: 26px;
  font-variant-numeric: tabular-nums;
}
.md-work-result {
  font-size: 20px;
  line-height: 1.35;
}
.md-work-details .md-work-spent {
  color: #b7c8bb;
  font-size: 13px;
  line-height: 1.4;
  margin: 0;
}
.md-work-cash {
  position: fixed;
  z-index: 60;
  color: #ffdf91;
  text-shadow: 0 2px 8px #061210;
  font-size: 25px;
  font-weight: 800;
  white-space: nowrap;
  pointer-events: none;
}
.md-work-paused .md-work-image,
.md-work[data-paused="true"] .md-work-image { animation-play-state: paused; }
@keyframes md-work-camera {
  from { transform: scale(1.035) translateX(-.5%); }
  to { transform: scale(1.08) translateX(.5%); }
}
@media (prefers-reduced-motion: reduce) {
  .md-work-image.is-visible { animation: none; transform: none; }
  .md-work-image, .md-work-steps li { transition: none; }
}
@media (max-width: 375px) {
  .md-work-details { padding: 13px 14px; }
  .md-work-details .md-shift-title { font-size: 16px; }
}


.md-holiday { border-color: #897a4f; padding: 18px; scroll-margin-top: 20px; }
.md-holiday header { border-bottom: 1px solid #81734b5e; padding-bottom: 12px; }
.md-holiday header h2 { margin: 4px 0 0; color: #f2d18e; font-size: 23px; }
.md-holiday-kicker { margin: 0; color: #bfcca9; font-size: 12px; }
.md-holiday-description, .md-holiday-economy { color: #b7c7bc; line-height: 1.5; }
.md-holiday-description { margin: 14px 0; }
.md-holiday-economy { font-size: 12px; margin: 12px 0; }
.md-holiday-stock { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 7px; }
.md-holiday-stock p { min-width: 0; margin: 0; padding: 10px 6px; background: #152421; border: 1px solid #42574a; border-radius: 10px; text-align: center; color: #b8c8bb; font-size: 12px; }
.md-holiday-stock strong, .md-holiday-stock small { display: block; }
.md-holiday-stock strong { color: #f3ddb1; font-size: 16px; margin: 5px 0; overflow-wrap: anywhere; }
.md-holiday-stock small { font-size: 10px; color: #92a99b; }
.md-holiday-sales { color: #bed1b8; font-size: 13px; margin: 14px 0; }
.md-holiday-sales strong { color: #f2d18e; }
.md-holiday-jobs { display: grid; gap: 12px; }
.md-holiday-job { display: grid; grid-template-columns: 78px minmax(0, 1fr); align-items: start; gap: 12px; border-top: 1px solid #53634b66; padding: 14px 0 0; }
.md-holiday-thumb { width: 78px; height: 78px; border-radius: 10px; object-fit: cover; background: #172725; }
.md-holiday-job-info { min-width: 0; }
.md-holiday-job h3 { margin: 0 0 5px; font-size: 16px; line-height: 1.3; }
.md-holiday-job-info p { margin: 5px 0 0; font-size: 13px; color: #b1c0b6; line-height: 1.4; }
.md-holiday-job-info .md-row-meta { color: #aec9af; }
.md-holiday-job-info .md-holiday-hint { color: #e6c780; }
.md-holiday-job > button { grid-column: 1 / -1; width: 100%; min-width: 0; white-space: normal; }
[data-md-work-job="giftsStock"] .md-work-image-wrap,
[data-md-work-job="champagneStock"] .md-work-image-wrap,
[data-md-work-job="holidayDecor"] .md-work-image-wrap,
[data-md-work-job="holidaySales"] .md-work-image-wrap { aspect-ratio: 4 / 3; }
@media (min-width: 620px) {
  .md-holiday-job { grid-template-columns: 90px minmax(0, 1fr) auto; align-items: center; }
  .md-holiday-thumb { width: 90px; height: 90px; }
  .md-holiday-job > button { grid-column: auto; width: auto; max-width: 190px; }
}
@media (max-width: 350px) {
  .md-holiday { padding: 12px; }
  .md-holiday-job { grid-template-columns: 62px minmax(0, 1fr); gap: 9px; }
  .md-holiday-thumb { width: 62px; height: 70px; }
  .md-holiday-stock strong { font-size: 14px; }
}


.md-cinematic-scene .md-caption { padding-right: 18px; }
.md-cinematic-preview { position: relative; padding: 0; overflow: hidden; }
.md-cinematic-preview img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.md-cinematic-portrait { margin: 14px 0; overflow: hidden; border: 1px solid var(--md-line); border-radius: 11px; background: var(--md-panel); }
.md-cinematic-portrait[hidden] { display: none; }
.md-cinematic-portrait img { display: block; width: 100%; height: auto; }
.md-cinematic-portrait figcaption { padding: 9px 12px; color: var(--md-muted); font-size: 12px; }


.mdi {
  --mdi-ink: #f4ead1;
  --mdi-subtle: #b7c5b6;
  --mdi-accent: #f2cf7e;
  --mdi-outline: #486154;
  margin-block: .75rem;
  padding: .65rem;
  border: 1px solid var(--mdi-outline);
  border-radius: .75rem;
  background: radial-gradient(ellipse at 45% 0, #283630, #17241f 74%);
  color: var(--mdi-ink);
}

.mdi-header, .mdi-game {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: .4rem;
}

.mdi-header {
  align-items: start;
  font-size: .94rem;
  line-height: 1.22;
}

.mdi-counter {
  color: var(--mdi-accent);
  font-size: .82rem;
  font-variant-numeric: tabular-nums;
  font-weight: 700;
  white-space: nowrap;
}

.mdi .mdi-hint {
  margin: .32rem 0 .54rem;
  color: var(--mdi-subtle);
  font-size: .75rem;
  line-height: 1.4;
}

.mdi-game {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.03fr);
  align-items: stretch;
  position: relative;
  isolation: isolate;
}

.mdi-stock, .mdi-target {
  min-width: 0;
  padding: .3rem;
  border: 1px solid #496355;
  border-radius: .57rem;
}

.mdi-stock {
  background: #1a2924;
}

.mdi-stock--truck {
  border: 2px solid #69746a;
  background: repeating-linear-gradient(90deg, #2c3733 0 8px, #222e2b 9px 10px);
  box-shadow: inset .35rem 0 .42rem #11201f, inset -.35rem 0 .42rem #11201f;
}

.mdi-stock-label, .mdi-target-label {
  display: block;
  max-width: 100%;
  padding: .08rem .12rem .27rem;
  color: var(--mdi-subtle);
  font-size: .69rem;
  line-height: 1.16;
  overflow-wrap: anywhere;
}

.mdi-items, .mdi-checklist {
  display: grid;
  gap: .23rem;
}

.mdi button.mdi-item, .mdi button.mdi-check, .mdi button.mdi-target {
  font: inherit;
  color: var(--mdi-ink);
  text-align: left;
  -webkit-tap-highlight-color: transparent;
}

.mdi button.mdi-item, .mdi button.mdi-check {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  align-items: center;
  gap: .31rem;
  min-width: 0;
  min-height: 2.75rem;
  padding: .17rem .27rem;
  border: 1px solid #3d5147;
  border-radius: .42rem;
  background: #22342c;
  box-sizing: border-box;
  font-size: .72rem;
  line-height: 1.1;
}

.mdi button.mdi-item {
  position: relative;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.mdi-item-label {
  overflow-wrap: anywhere;
}

.mdi-item:not(:disabled), .mdi-check:not(:disabled) {
  border-color: #b59856;
  background: linear-gradient(135deg, #3f4230, #2c392d);
  color: #fff1ca;
}

.mdi-item:not(:disabled) {
  cursor: grab;
}

.mdi-check:not(:disabled), .mdi-target:not(:disabled) {
  cursor: pointer;
}

.mdi-item:disabled, .mdi-check:disabled {
  color: #b2bdb0;
}

.mdi-item[data-mdi-done="true"] {
  visibility: hidden;
}

.mdi-item[aria-pressed="true"] {
  border-color: var(--mdi-accent);
  box-shadow: 0 0 0 1px var(--mdi-accent);
}

.mdi-item.mdi-dragging {
  z-index: 4;
  pointer-events: none;
  transform: translate3d(var(--mdi-dx, 0), var(--mdi-dy, 0), 0);
  box-shadow: 0 .25rem .65rem #081210a8;
}

.mdi-target {
  display: flex;
  flex-direction: column;
  position: relative;
  background: #1d2e26;
  overflow: hidden;
}

.mdi-target-label {
  color: #f0deaf;
  font-weight: 700;
}

.mdi-target-area {
  flex: 1 1 auto;
  display: grid;
  position: relative;
  width: 100%;
  min-height: 6.3rem;
  aspect-ratio: 1 / 1;
}

.mdi-scene, .mdi-load {
  grid-area: 1 / 1;
}

.mdi-scene {
  position: relative;
  align-self: stretch;
  border: 1px solid #4a5d53;
  border-radius: .38rem;
  background: #172722;
}

.mdi-target--truck .mdi-scene {
  margin: .06rem .03rem .43rem;
  border: .2rem solid #8a9586;
  border-bottom: .12rem solid #555d55;
  background:
    linear-gradient(112deg, #1e2b28b0 0 17%, transparent 27% 73%, #15221eb8 83% 100%),
    linear-gradient(0deg, #404d45 1%, #3a4641 22%, #27332e 24%, #141f1c 80%, #405249 86%, #25352d 100%);
  box-shadow: inset 0 0 0 .11rem #27372f, 0 .12rem .3rem #0c1b16;
}

.mdi-target--truck .mdi-scene::before {
  content: "";
  position: absolute;
  inset: 45% 9% .07rem;
  clip-path: polygon(25% 0, 75% 0, 100% 100%, 0 100%);
  background: repeating-linear-gradient(180deg, #46554b 0 8px, #344239 9px 10px);
  box-shadow: inset 0 .8rem .8rem #233229a5;
}

.mdi-target--truck .mdi-scene::after {
  content: "";
  position: absolute;
  right: -.2rem;
  bottom: -.42rem;
  left: -.2rem;
  height: .43rem;
  border-radius: 0 0 .23rem .23rem;
  background: linear-gradient(90deg, #81352e 0 13%, #69786d 15% 85%, #81352e 87%);
  box-shadow: 0 2px 0 #0f1a15;
}

.mdi-target--pallet .mdi-scene {
  margin: 38% 5% 8%;
  border-color: #6d5837;
  border-width: .19rem .15rem .39rem;
  background: repeating-linear-gradient(90deg, #8d734b 0 10px, #382f23 11px 13px);
  transform: perspective(9rem) rotateX(31deg);
  box-shadow: 0 4px 0 #18231d;
}

.mdi-target--shelf .mdi-scene {
  border: .2rem solid #69563c;
  background: repeating-linear-gradient(180deg, #25332a 0 29%, #4c3a2a 30%, #897050 32% 35%);
  box-shadow: inset 0 0 .9rem #17231d;
}

.mdi-target--window .mdi-scene {
  border: .2rem solid #849688;
  background:
    linear-gradient(90deg, transparent 48%, #849688 49% 51%, transparent 52%),
    linear-gradient(0deg, #6f8a8a45 48%, #849688 49% 51%, #304d4e 52%);
  box-shadow: inset .7rem 0 1.1rem #203c45, inset -.8rem 0 1.1rem #203c45;
}

.mdi-target--bag .mdi-scene {
  margin: 22% 9% 6%;
  border: .15rem solid #826541;
  clip-path: polygon(26% 0, 75% 0, 100% 91%, 90% 100%, 10% 100%, 0 91%);
  background: linear-gradient(100deg, #6e5030 0, #9e7b4a 19%, #735635 50%, #8a6945 82%, #5f442b);
  box-shadow: inset 0 .3rem .6rem #473823;
}

.mdi-target--bench .mdi-scene {
  margin-block: 10% 8%;
  border: .18rem solid #556e5b;
  background: repeating-linear-gradient(90deg, #293f34 0 1.1rem, #385143 1.14rem 1.19rem);
  box-shadow: inset 0 0 .7rem #16271c;
}

.mdi-target--hub .mdi-scene {
  margin: 12% 5%;
  border: 0;
  background:
    radial-gradient(circle at 50% 49%, #879582 0 8%, #465850 9% 13%, #a3ab9a 14% 19%, #344942 20% 24%, #212c27 25% 29%, transparent 30%),
    radial-gradient(ellipse at 50% 69%, #111c18 0 38%, #45584c 40% 46%, transparent 47%),
    repeating-linear-gradient(0deg, transparent 0 1.1rem, #51675a55 1.13rem 1.19rem), #253a30;
}

.mdi-load {
  z-index: 1;
  align-self: end;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  justify-items: center;
  gap: .12rem;
  margin: .25rem;
  padding: .15rem;
}

.mdi-target--truck .mdi-load {
  margin: .48rem .22rem .73rem;
}

.mdi-target--shelf .mdi-load, .mdi-target--window .mdi-load {
  align-self: center;
}

.mdi-load [data-mdi-loaded][hidden] {
  display: none;
}

@media (prefers-reduced-motion: no-preference) {
  .mdi-load [data-mdi-loaded]:not([hidden]) {
    animation: mdi-place .2s ease-out;
  }
}

@keyframes mdi-place {
  from { transform: translateY(-.3rem); opacity: .46; }
  to { transform: translateY(0); opacity: 1; }
}

.mdi-target.mdi-drop-hover, .mdi[data-mdi-selected="true"] .mdi-target {
  border-color: var(--mdi-accent);
  background: #394636;
  box-shadow: inset 0 0 0 1px #d7b665;
}

.mdi button.mdi-item:focus-visible, .mdi button.mdi-target:focus-visible, .mdi button.mdi-check:focus-visible {
  outline: 2px solid #ffe29b;
  outline-offset: 2px;
}

.mdi-object {
  position: relative;
  flex: none;
  display: inline-block;
  width: 1.48rem;
  height: 1.36rem;
  vertical-align: middle;
  filter: drop-shadow(0 .15rem .12rem #101c15a8);
}

.mdi-object[class*="mdi-object--glass-"] {
  width: .97rem;
  height: 1.62rem;
  justify-self: center;
  --glass-light: #6d9c67;
  --glass-dark: #254e36;
  clip-path: polygon(34% 0, 66% 0, 67% 9%, 64% 12%, 65% 35%, 78% 41%, 86% 49%, 87% 92%, 75% 100%, 25% 100%, 13% 92%, 14% 49%, 22% 41%, 35% 34%, 36% 12%, 32% 9%);
  background: linear-gradient(0deg, transparent 27%, #ede2ad86 28% 52%, transparent 53%),
    linear-gradient(90deg, var(--glass-dark), var(--glass-light) 44%, var(--glass-dark) 100%);
}

.mdi-object.mdi-object--glass-clear {
  --glass-light: #bbc9bb;
  --glass-dark: #5c817b;
}

.mdi-object.mdi-object--glass-brown {
  --glass-light: #a77a53;
  --glass-dark: #663e30;
}

.mdi-object[class*="mdi-object--cardboard"], .mdi-object--paper-stack {
  --stack-light: #b58f58;
  --stack-dark: #775634;
  height: .98rem;
  margin-block: .2rem;
  transform: skewY(-7deg);
  border-radius: .08rem;
  background:
    linear-gradient(90deg, transparent 32%, #d8c490 33% 37%, transparent 38% 65%, #d8c490 66% 70%, transparent 72%),
    repeating-linear-gradient(0deg, var(--stack-light) 0 2px, var(--stack-dark) 3px 4px);
  box-shadow: inset 0 0 0 1px #5a4931ab;
}

.mdi-object.mdi-object--cardboard-light {
  --stack-light: #c59c65;
  --stack-dark: #8c663a;
}

.mdi-object.mdi-object--paper-stack {
  --stack-light: #b9b7a2;
  --stack-dark: #768477;
}

.mdi-object[class*="mdi-object--crate-"] {
  --produce: #a95d4c;
  --produce-light: #d88b6d;
  border-radius: .13rem .13rem .19rem .19rem;
  background:
    radial-gradient(circle at 26% 22%, var(--produce-light) 0 13%, var(--produce) 15% 23%, transparent 25%),
    radial-gradient(circle at 70% 20%, var(--produce) 0 25%, transparent 27%);
}

.mdi-object[class*="mdi-object--crate-"]::after {
  content: "";
  position: absolute;
  inset: 36% 0 0;
  border: 1px solid #5f4730;
  border-radius: .07rem;
  background: repeating-linear-gradient(0deg, #a0855d 0 3px, #624c35 4px 5px);
  box-shadow: inset 2px 0 #9b7446, inset -2px 0 #715536;
}

.mdi-object.mdi-object--crate-orange {
  --produce: #b47136;
  --produce-light: #e2a346;
}

.mdi-object.mdi-object--crate-green {
  --produce: #5b8c4e;
  --produce-light: #94ae5d;
}

.mdi-object.mdi-object--crate-glass {
  --produce: #426c62;
  --produce-light: #c5ddd0;
}

.mdi-object[class*="mdi-object--parcel"], .mdi-object[class*="mdi-object--gift"] {
  --paper: #a98959;
  --paper-dark: #7e633e;
  --tie: #e0c78a;
  height: 1.2rem;
  border-radius: .09rem;
  background: linear-gradient(90deg, transparent 48%, var(--tie) 49% 63%, transparent 65%),
    linear-gradient(0deg, var(--paper-dark) 0 9%, var(--paper) 12% 78%, var(--paper-dark) 80% 87%, var(--paper) 89%);
  box-shadow: inset 0 0 0 1px #0003;
}

.mdi-object.mdi-object--parcel-green, .mdi-object.mdi-object--gift-green {
  --paper: #6b8e58;
  --paper-dark: #577041;
}

.mdi-object.mdi-object--parcel-gold, .mdi-object.mdi-object--gift-gold {
  --paper: #ad8548;
  --paper-dark: #87663a;
}

.mdi-object.mdi-object--parcel-blue {
  --paper: #668e94;
  --paper-dark: #45676d;
}

.mdi-object.mdi-object--gift-red {
  --paper: #9e5044;
  --paper-dark: #713d33;
}

.mdi-object[class*="mdi-object--gift"] {
  border-top: .08rem solid var(--tie);
}

.mdi-object--wheel {
  width: 1.36rem;
  border-radius: 50%;
  background: radial-gradient(circle, #303c36 0 7%, #8e9b8b 8% 17%, #56695c 18% 31%, #b0b9a4 32% 43%, #34413a 45% 54%, #111b17 56% 68%, #33443b 71%);
}

.mdi-object--wrench, .mdi-object--keys {
  height: 1.36rem;
  background: linear-gradient(135deg, #d4dbca, #7b9186 58%, #afb6a6);
  clip-path: polygon(78% 1%, 96% 11%, 84% 24%, 88% 33%, 100% 21%, 100% 42%, 81% 55%, 66% 53%, 23% 99%, 10% 99%, 5% 89%, 10% 78%, 56% 40%, 56% 23%, 63% 8%);
}

.mdi-object--keys {
  transform: rotate(-26deg) scale(.9);
  background: #c6ab73;
}

.mdi-object--jack {
  background: linear-gradient(0deg, #4c3026 0 21%, #a76d50 25%, #6a8c78 73%, #aabca7);
  clip-path: polygon(13% 78%, 36% 68%, 62% 27%, 82% 25%, 86% 43%, 70% 46%, 53% 68%, 87% 68%, 100% 78%, 94% 96%, 7% 96%);
}

.mdi-object--scanner {
  width: 1.04rem;
  height: 1.33rem;
  border: .15rem solid #565e52;
  border-radius: .2rem;
  background: linear-gradient(0deg, #2b4237 0 40%, #a5be62 43% 90%, #3c5143);
}

.mdi-object--pump {
  background: linear-gradient(90deg, #567863, #c3cc92, #57715c);
  clip-path: polygon(12% 4%, 83% 4%, 83% 19%, 53% 19%, 53% 42%, 64% 42%, 64% 81%, 94% 81%, 94% 97%, 8% 97%, 8% 81%, 38% 81%, 38% 19%, 12% 19%);
}

.mdi-object--oil {
  background: linear-gradient(82deg, #6e7844, #c89643 58%, #8d643e);
  clip-path: polygon(0 67%, 17% 60%, 17% 38%, 61% 37%, 69% 44%, 86% 8%, 99% 8%, 86% 63%, 77% 71%, 75% 99%, 3% 99%);
}

.mdi-object--lights {
  background:
    radial-gradient(circle at 19% 62%, #ffeba5 0 12%, transparent 15%),
    radial-gradient(circle at 51% 50%, #f3c15a 0 12%, transparent 15%),
    radial-gradient(circle at 82% 65%, #ffeba5 0 12%, transparent 15%);
}

.mdi-object--spruce {
  background: linear-gradient(120deg, #587e59, #87a078 42%, #304f42 65%);
  clip-path: polygon(51% 1%, 66% 27%, 61% 27%, 80% 53%, 69% 52%, 95% 81%, 56% 80%, 56% 97%, 44% 97%, 44% 80%, 4% 81%, 29% 52%, 18% 53%, 39% 27%, 33% 27%);
}

.mdi-object--star {
  background: linear-gradient(145deg, #ffe788, #aa7436);
  clip-path: polygon(50% 0, 64% 34%, 100% 39%, 73% 64%, 80% 100%, 50% 82%, 20% 100%, 27% 64%, 0 39%, 36% 34%);
}

.mdi button.mdi-check {
  grid-template-columns: 1.14rem minmax(0, 1fr);
  padding-inline: .48rem;
  font-size: .8rem;
}

.mdi-check-mark {
  width: .9rem;
  height: .9rem;
  border: 1px solid #87998b;
  border-radius: .22rem;
}

.mdi-check[data-mdi-done="true"] .mdi-check-mark {
  position: relative;
  background: #59765e;
}

.mdi-check[data-mdi-done="true"] .mdi-check-mark::after {
  content: "";
  position: absolute;
  inset: .14rem .17rem .26rem;
  border: solid #fff1ca;
  border-width: 0 0 .12rem .12rem;
  transform: rotate(-45deg);
}

.mdi-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}


.mdpi {
  --mdpi-mark: #ffe197;
  min-width: 0;
}

.mdpi-photo {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  background: #17231f;
}

.mdpi-scene {
  display: block;
  width: 100%;
  height: auto;
  user-select: none;
  -webkit-user-drag: none;
}

.md-work:is([data-md-work-total="4"], [data-md-work-total="5"]) .md-work-steps {
  grid-template-columns: none;
  grid-auto-flow: column;
  grid-auto-columns: minmax(0, 1fr);
}

.md-work-dismiss {
  display: block;
  margin-top: .7rem;
}

.mdpi-reading:not([hidden]) {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  background: #101b13;
  color: #8ee3a4;
  font: 700 .5rem/1 ui-monospace, monospace;
  pointer-events: none;
}

.mdpi button.mdpi-item, .mdpi span.mdpi-item, .mdpi button.mdpi-target, .mdpi button.mdpi-action {
  position: absolute;
  display: grid;
  place-items: center;
  margin: 0;
  padding: 0;
  border: 0;
  border-radius: .23rem;
  background: none;
  color: var(--mdpi-mark);
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
  -webkit-tap-highlight-color: transparent;
}

.mdpi:not([data-mdpi-ready="true"]) :is(button, .mdpi-item),
.mdpi:not([data-mdpi-image-ready="true"]) :is(button, .mdpi-item) {
  visibility: hidden;
}

.mdpi button.mdpi-item {
  touch-action: none;
  z-index: 2;
}

.mdpi button.mdpi-item:not(:disabled) {
  cursor: grab;
  z-index: 4;
}

.mdpi button.mdpi-item:not(:disabled)::before, .mdpi button.mdpi-action::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 100%;
  height: 100%;
  min-width: 44px;
  min-height: 44px;
  transform: translate(-50%, -50%);
}

.mdpi .mdpi-item img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}

.mdpi button.mdpi-item[data-mdpi-active="true"] img {
  filter: drop-shadow(0 0 1px #241d0f) drop-shadow(0 0 4px #ffe197db);
}

.mdpi .mdpi-item[data-mdpi-placed="true"] {
  z-index: 1;
}

.mdpi button.mdpi-item.mdpi-dragging {
  z-index: 6;
  pointer-events: none;
  transform: translate3d(var(--mdpi-dx, 0), var(--mdpi-dy, 0), 0);
}

.mdpi button.mdpi-item.mdpi-dragging img {
  filter: drop-shadow(0 3px 4px #09130f8a);
}

.mdpi button.mdpi-target {
  z-index: 3;
  border: 1px dashed #ffda87c2;
  background: #201a0c2e;
}

.mdpi button.mdpi-target:disabled {
  pointer-events: none;
}

.mdpi button.mdpi-target.mdpi-hover, .mdpi[data-mdpi-selected="true"] button.mdpi-target {
  border-style: solid;
  border-color: var(--mdpi-mark);
  background: #cfa64a35;
  box-shadow: inset 0 0 0 1px #20140dbb;
}

.mdpi-target span, .mdpi-action span {
  padding: .18rem .33rem;
  border-radius: .23rem;
  background: #17241be8;
  box-shadow: 0 1px 3px #0e140cb3;
  font-size: .7rem;
  font-weight: 700;
  line-height: 1.1;
  pointer-events: none;
}

.mdpi button.mdpi-action {
  z-index: 4;
  border: 1px dashed var(--mdpi-mark);
  background: #29210b38;
}

.mdpi button[data-mdpi-hold],
.mdpi button[data-mdpi-tap] {
  touch-action: none;
}

.mdpi button.mdpi-holding {
  border-style: solid;
  background: #cfa64a35;
}

.mdpi button.mdpi-holding::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 3px;
  background: var(--mdpi-mark);
  animation: mdpi-fastening 700ms linear both;
  transform-origin: left center;
  pointer-events: none;
}

@keyframes mdpi-fastening {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@media (prefers-reduced-motion: reduce) {
  .mdpi button.mdpi-holding::after { animation: none; }
}

.mdpi button.mdpi-item:focus-visible, .mdpi button.mdpi-target:focus-visible,
.mdpi button.mdpi-action:focus-visible, .mdpi button.mdpi-item[aria-pressed="true"] {
  outline: 2px solid var(--mdpi-mark);
  outline-offset: 2px;
}

.mdpi-caption {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: .35rem;
  padding: .58rem .75rem .24rem;
  color: #f0e9d4;
  font-size: .9rem;
  line-height: 1.22;
}

.mdpi-caption output {
  color: var(--mdpi-mark);
  font-size: .78rem;
  font-variant-numeric: tabular-nums;
  font-weight: 740;
  white-space: nowrap;
}

.mdpi p.mdpi-hint {
  margin: 0;
  padding: 0 .75rem .37rem;
  color: #b7c6b8;
  font-size: .7rem;
  line-height: 1.35;
}

.mdpi-sr {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
/* Photo-local controls for manual jobs. */
.mdjt {
  position: absolute;
  z-index: 7;
  inset: 0;
  color: #ffe4a3;
  pointer-events: none;
  user-select: none;
  -webkit-user-select: none;
}

.mdpi .mdjt-hint {
  margin: 0;
  padding: 0 .75rem .5rem;
  color: #c3cebc;
  font-size: .75rem;
  line-height: 1.3;
}

.mdpi .mdjt button.mdjt-mark {
  position: absolute;
  display: grid;
  place-items: center;
  min-width: 44px;
  min-height: 44px;
  margin: 0;
  padding: 0;
  border: 2px solid #fae29f;
  border-radius: 50%;
  background: #1a241fe8;
  box-shadow: 0 2px 4px #121810a8;
  color: inherit;
  font: 750 1.25rem/1 system-ui, sans-serif;
  transform: translate(-50%, -50%) translate(var(--mdjt-dx, 0px), var(--mdjt-dy, 0px));
  pointer-events: auto;
  touch-action: none;
  -webkit-tap-highlight-color: transparent;
  -webkit-touch-callout: none;
}

.mdpi .mdjt button.mdjt-mark:disabled {
  pointer-events: none;
}

.mdpi .mdjt button.mdjt-mark:focus-visible {
  outline: 2px solid white;
  outline-offset: 3px;
}

.mdpi .mdjt button.mdjt-mark.mdjt-moving {
  z-index: 3;
  cursor: grabbing;
}

.mdjt-grip,
.mdjt[data-mdjt="sort"] .mdjt-point,
.mdjt-dial { cursor: grab; }
.mdjt-press,
.mdjt-drop { cursor: pointer; }

.mdjt-rail {
  position: absolute;
  min-width: 20px;
  min-height: 20px;
  border-radius: .6rem;
  background: #101d1694;
  box-shadow: inset 0 0 0 1px #ffe1a068;
}

.mdjt-rail::before {
  position: absolute;
  content: "";
  inset: 10% auto 10% 50%;
  border-left: 2px dashed #ffe1a0ae;
  transform: translateX(-50%);
}

.mdjt-rail[data-mdjt-rail="x"]::before {
  inset: 50% 10% auto 10%;
  border: 0;
  border-top: 2px dashed #ffe1a0ae;
  transform: translateY(-50%);
}

.mdjt-rail::after {
  position: absolute;
  content: "";
  bottom: 0;
  right: 0;
  width: 3px;
  height: 100%;
  border-radius: inherit;
  background: #bde3af;
  transform: scaleY(var(--mdjt-progress, 0));
  transform-origin: bottom;
}

.mdjt-rail[data-mdjt-rail="x"]::after {
  right: auto;
  left: 0;
  width: 100%;
  height: 3px;
  transform: scaleX(var(--mdjt-progress, 0));
  transform-origin: left;
}

.mdjt-arrow {
  position: absolute;
  left: 50%;
  top: 50%;
  color: #ffe4a3;
  text-shadow: 0 1px 4px #121912, 1px 1px 1px #121912;
  font: 750 1.35rem/1 system-ui, sans-serif;
  transform: translate(-50%, -50%);
}

.mdpi .mdjt button.mdjt-dial {
  min-width: 72px;
  min-height: 72px;
  transform: none;
  background: #10201868;
}

.mdjt-dial::before,
.mdjt-dial::after {
  position: absolute;
  content: "";
  inset: 0;
  border-radius: 50%;
  pointer-events: none;
}

.mdjt-dial::before {
  border: 4px solid #bde3af;
  mask: conic-gradient(#000 calc(var(--mdjt-turn-progress, 0) * 360deg), transparent 0);
}

.mdjt-dial::after {
  background: radial-gradient(circle 5px at 93% 50%, #ffedb2 80%, transparent 100%);
  transform: rotate(var(--mdjt-angle, 0rad));
}

.mdjt-dial-icon {
  border-radius: 50%;
  padding: .3rem;
  background: #1a241eef;
  font-size: 1.4em;
  pointer-events: none;
}

.mdjt-path {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: #ffdf90;
  stroke-width: 3px;
  stroke-dasharray: 5 5;
  filter: drop-shadow(0 0 2px #080e09);
}

.mdjt-dot {
  position: absolute;
  width: 14px;
  height: 14px;
  border: 2px solid #ffe4a3;
  border-radius: 50%;
  background: #182219;
  transform: translate(-50%, -50%);
  box-shadow: 0 1px 4px #111a13;
}

.mdjt-dot[data-mdjt-done] {
  border-color: #bddcae;
  background: #bddcae;
  box-shadow: 0 0 7px #bbef85b3;
}

.mdpi .mdjt button.mdjt-drop {
  min-width: 48px;
  min-height: 48px;
  border-style: dashed;
  background: #131f16bd;
}

.mdpi .mdjt button.mdjt-drop:enabled,
.mdpi .mdjt button.mdjt-mark[aria-pressed="true"] {
  border-color: #fff1c6;
  box-shadow: 0 0 0 3px #dfcd9268;
}

.mdpi .mdjt button.mdjt-mark[data-mdjt-done],
.mdpi .mdjt button.mdjt-drop.mdjt-hover {
  border-color: #b7e5a8;
  background: #264330e8;
  color: #dfefce;
}

.mdpi .mdjt[data-mdjt="sort"] button.mdjt-point[data-mdjt-done] {
  visibility: hidden;
}

.mdpi .mdjt button.mdjt-mark.mdjt-miss {
  border-color: #f3a373;
  background: #6b3e2bea;
}

.mdpi .mdjt button.mdjt-press:disabled:not([data-mdjt-done]) {
  opacity: .5;
}

.mdjt-holding::after {
  position: absolute;
  content: "";
  inset: 1px;
  border-radius: 50%;
  border: 3px solid #c9edb8;
  animation: mdjt-press var(--mdjt-hold) linear both;
}

@keyframes mdjt-press {
  from { clip-path: inset(100% 0 0); }
  to { clip-path: inset(0); }
}

.md-work:has(.mdpi:not([data-mdpi-complete])) :is(.md-work-phase, .md-work-time, .md-work-steps) {
  display: none;
}

.mdpi-caption {
  align-items: center;
  min-height: 2.45rem;
  padding-block: .42rem;
}

.mdpi-caption strong {
  font-weight: 650;
}

.mdpi-target span {
  display: grid;
  place-items: center;
  min-width: 1.2rem;
  min-height: 1.2rem;
  padding: .12rem;
}

.mdpi-caption .mdjt-hint {
  padding: 0;
  color: inherit;
  font-size: inherit;
  font-weight: 650;
}
