/* The leave scene of the 好人好事 demo. Colours, type and spacing only through the variables of ../tokens.css.
   Motion: the names and values of the motion group in brand-system/project/tokens.json, declared here because ../tokens.css lacks them. */
:root{--motion-fast:160ms;--motion-press-scale:.98;--ease:cubic-bezier(.22,1,.36,1)}

/* The pinned faces of ../ lack 21 characters of this page (words such as 假, 甲, 薪). Supplementary faces cut from the same OFL
   sources at the same weights hold only those characters; the pinned faces serve every other character. */
@font-face{font-family:"SX Display";src:url("fonts/noto-serif-tc-700-leave.woff2") format("woff2");font-style:normal;font-weight:700;font-display:swap;unicode-range:U+4EFB,U+4F30,U+5047,U+5065,U+52DE,U+52E4,U+542B,U+5EB7,U+675F,U+7532,U+7642,U+767B,U+7D0D,U+7DE8,U+85AA,U+8A16,U+908A,U+91AB,U+9808,U+9918,U+9A5F}
@font-face{font-family:"SX Text";src:url("fonts/noto-sans-tc-400-leave.woff2") format("woff2");font-style:normal;font-weight:400;font-display:swap;unicode-range:U+4EFB,U+4F30,U+5047,U+5065,U+52DE,U+52E4,U+542B,U+5EB7,U+675F,U+7532,U+7642,U+767B,U+7D0D,U+7DE8,U+85AA,U+8A16,U+908A,U+91AB,U+9808,U+9918,U+9A5F}
@font-face{font-family:"SX Text";src:url("fonts/noto-sans-tc-500-leave.woff2") format("woff2");font-style:normal;font-weight:500;font-display:swap;unicode-range:U+4EFB,U+4F30,U+5047,U+5065,U+52DE,U+52E4,U+542B,U+5EB7,U+675F,U+7532,U+7642,U+767B,U+7D0D,U+7DE8,U+85AA,U+8A16,U+908A,U+91AB,U+9808,U+9918,U+9A5F}
@font-face{font-family:"SX Text";src:url("fonts/noto-sans-tc-700-leave.woff2") format("woff2");font-style:normal;font-weight:700;font-display:swap;unicode-range:U+4EFB,U+4F30,U+5047,U+5065,U+52DE,U+52E4,U+542B,U+5EB7,U+675F,U+7532,U+7642,U+767B,U+7D0D,U+7DE8,U+85AA,U+8A16,U+908A,U+91AB,U+9808,U+9918,U+9A5F}

/* one polite live region (leave.js announce): visually hidden, still read out */
.live{position:absolute;width:1px;height:1px;margin:-1px;padding:0;overflow:hidden;clip:rect(0 0 0 0);clip-path:inset(50%);white-space:nowrap;border:0}

.sx-demo-strip{font:14px/1.7 var(--font-text);color:var(--text-muted);background:var(--ground-deep);border-bottom:1px solid var(--line);padding:var(--space-3) var(--space-5);display:flex;align-items:center;justify-content:space-between;gap:var(--space-4);flex-wrap:wrap}
.sx-demo-strip a{color:inherit;display:inline-flex;align-items:center;min-height:44px}

.scene-main{width:min(1120px,calc(100% - 32px))}
.topbar,footer{max-width:1152px}

/* the list of seven steps: a list, not buttons */
.scene-steps{list-style:none;margin:var(--space-3) 0 var(--space-4);padding:0;display:flex;flex-wrap:wrap;gap:var(--space-2)}
.scene-steps li{display:flex;align-items:center;gap:var(--space-2);min-height:32px;padding:var(--space-1) var(--space-3);border:1px solid var(--line);background:var(--surface);color:var(--text-muted);font:500 13px/1.3 var(--font-text);transition:color var(--motion-fast) ease-out,border-color var(--motion-fast) ease-out}
.scene-steps li::before{content:"";flex:none;width:10px;height:10px;border:1px solid currentColor;border-radius:var(--radius-round)}
.scene-steps li[data-state=done]{color:var(--text)}
.scene-steps li[data-state=done]::before{background:currentColor}
.scene-steps li[aria-current=step]{color:var(--text);border-color:var(--brass);font-weight:700}
.scene-steps li[aria-current=step]::before{background:var(--brass);border-color:var(--brass)}
.step-sentence{display:none}

/* 重設示範: third-level control of components/Button (brass-tint ground, 1px brass edge, at least 44px), never solid at rest */
.scene-tools{margin:0 0 var(--space-4)}
.reset{min-width:44px;min-height:44px;padding:var(--space-2) var(--space-4);border:1px solid var(--brass);background:var(--brass-tint);color:var(--text);font:500 14px/1.3 var(--font-text);cursor:pointer;transition:transform var(--motion-fast) var(--ease),background-color var(--motion-fast) ease-out,color var(--motion-fast) ease-out}
.reset:focus-visible{outline:2px solid var(--text);outline-offset:-4px}
.reset:active{background:var(--brass);color:var(--on-brass);transform:scale(var(--motion-press-scale))}
@media(hover:hover){.reset:hover{box-shadow:inset 0 0 0 1px var(--brass)}}

/* three devices; the one whose control is next carries the brass top line */
.scene{display:grid;gap:var(--space-5);margin-bottom:var(--space-7)}
@media(min-width:900px){.scene{grid-template-columns:repeat(3,minmax(0,1fr));align-items:start}}
.device{min-width:0;padding:var(--space-4);border:1px solid var(--line);border-top:2px solid var(--line);background:var(--ground-deep);transition:border-color var(--motion-fast) ease-out}
.device.is-turn{border-color:var(--line-strong);border-top-color:var(--brass)}
.device-label{margin:0 0 var(--space-2);font:700 16px/1.5 var(--font-display)}
.device-sentence{margin:0 0 var(--space-3);font-size:14px;line-height:1.7}
.device-sentence p{margin:0}
.device-sentence p+p{margin-top:var(--space-2)}
.device-label:focus-visible,.screen:focus-visible{outline:3px solid var(--line-strong);outline-offset:3px}
.screen{min-width:0;padding:var(--space-4);border:1px solid var(--line-strong);background:var(--surface)}
.view>*+*{margin-top:var(--space-3)}
.view h3,.view h4,.view p,.view ul,.view dl{margin-bottom:0}

/* what the live screens show */
.bar{display:flex;flex-wrap:wrap;align-items:baseline;gap:var(--space-1) var(--space-3);padding-bottom:var(--space-2);border-bottom:1px solid var(--line)}
.bar-brand{font:700 18px/1.4 var(--font-display)}
.bar-sub{font-size:13px;color:var(--text-muted)}
.bar-role{margin-left:auto;font-size:13px}
.screen-title{font-size:22px;line-height:1.4}
.screen-sub{font:700 18px/1.4 var(--font-display)}
.screen-name{font-size:14px;color:var(--text-muted)}
.screen-notice{padding:var(--space-2) var(--space-3);border:1px solid var(--line-strong);background:var(--ground);font-size:14px}
.top-buttons{display:grid;grid-template-columns:repeat(4,minmax(0,1fr));gap:var(--space-2)}
.fields{display:grid;gap:var(--space-2)}
.fields div{display:grid;gap:var(--space-1)}
.fields dt{font-size:13px;color:var(--text-muted)}
.fields dd{display:flex;align-items:center;min-height:44px;margin:0;padding:var(--space-2) var(--space-3);border:1px solid var(--line);background:var(--ground)}
.attach{display:grid;gap:var(--space-2)}
.attach-label{font-size:13px;color:var(--text-muted)}
.attach-note{display:flex;align-items:flex-start;gap:var(--space-2);font-size:14px}
.box{flex:none;width:18px;height:18px;margin-top:4px;border:1px solid var(--line-strong);background:var(--surface)}
.pay{padding:var(--space-3);background:var(--ground-deep);font-size:14px}
.entry>*+*{margin-top:var(--space-2)}
.entry p{margin-bottom:0}
.entry-who{font:700 18px/1.4 var(--font-display)}
.entry-meta{color:var(--text-muted);font-size:13px;line-height:1.7}
.entry-time{font-weight:500}
.counts{display:grid;gap:var(--space-1);margin:0;padding:0;list-style:none;font-size:14px}
.decide p{margin:var(--space-3) 0 var(--space-2);color:var(--text-muted);font-size:13px;line-height:1.6}

/* one entry; each device draws it at a press of its own person, so each device carries its own data-entry */
#scene .device[data-entry=draft] [data-state],#scene .device[data-entry=pending] [data-state=approved],#scene .device[data-entry=approved] [data-state=pending]{display:none}
#scene .device[data-entry=approved] [data-pending-only]{display:none}
[data-sent-only]{display:none}
#scene[data-sent=yes] [data-sent-only]{display:block}

/* controls: the step's own control is the one solid button of the screen; the rest are read-only */
.screen button{min-width:44px;min-height:44px;padding:var(--space-2);border:1px solid var(--line-strong);background:var(--surface);color:var(--text);font:500 14px/1.3 var(--font-text);transition:transform var(--motion-fast) var(--ease),background-color var(--motion-fast) ease-out,border-color var(--motion-fast) ease-out,color var(--motion-fast) ease-out}
.screen button:disabled{border-color:var(--line);color:var(--text-muted);cursor:default}
.screen button.is-page{border-color:var(--text);font-weight:700}
.send{justify-self:start;min-width:96px}
.decide button{min-width:96px}
.screen button.control{border-color:var(--brass);background:var(--brass);color:var(--on-brass);font-weight:700;cursor:pointer}
.screen button:not(:disabled):active{transform:scale(var(--motion-press-scale))}
.screen button.control:active{background:var(--brass-soft)}
@media(hover:hover){.screen button.control:hover{background:var(--brass-soft)}}

/* 換場: opacity only */
@keyframes scene-in{from{opacity:0}to{opacity:1}}
.view.enter{animation:scene-in var(--motion-fast) var(--ease) both}
@media(prefers-reduced-motion:reduce){.screen button:not(:disabled):active,.reset:active{transform:none}}
