.upload-scope {color:#aa2423;font-weight:750;line-height:1.5}
.session-away body {visibility:hidden}
#upload-page {max-width:760px;margin:auto;min-height:100vh;background:var(--card)}
#upload-page .sheet-head {position:sticky;top:0;z-index:4;background:var(--card);padding-top:max(12px,env(safe-area-inset-top))}
#upload-page h1 {flex:1;font-size:1.25rem}
#upload-page .upload-choices {grid-template-columns:1fr}
.pick {position:relative;display:flex;align-items:center;gap:10px;padding:12px 16px;min-height:50px;cursor:pointer}
.pick input[type=file] {position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.pick:focus-within {outline:3px solid var(--ink);outline-offset:2px}
.upload-additions {display:grid;gap:9px;padding:12px;border:1px solid #bbcfb5;border-radius:12px;background:#f0f6eb}
.upload-batch {display:flex;align-items:baseline;justify-content:space-between;flex-wrap:wrap;gap:5px 12px;color:#174d35}
.upload-batch strong {font-size:17px}
.upload-batch span,.upload-add-hint {font-size:13px;line-height:1.5;color:#496246}
.upload-add-hint {margin:0}
#upload-page .upload-more-choices {grid-template-columns:repeat(2,minmax(0,1fr));gap:8px}
.upload-more-choices .pick {justify-content:center;min-width:0;padding:10px 8px;gap:6px;font-size:15px;background:#fffef8}
.upload-more-choices .pick[data-source=camera] {border:2px solid #8a4b12;background:#f7b34b;color:#402400;font-weight:750}
.upload-more-choices .pick[data-source=camera]:hover {background:#ffc76b}
.upload-more-choices .pick[data-source=documents] {grid-column:1/-1;font-size:13px;min-height:42px}
.upload-more-choices .pick-full {opacity:.5;cursor:not-allowed}
.upload-more-choices .pick-full input {cursor:not-allowed}
#upload-page .upload-actions .btn {min-width:0}
#upload-page .upload-actions .btn.primary:disabled {background:#e5e7e2;border-color:#b8c1b3;color:#63715e;cursor:not-allowed}
#upload-page .crop-editor {scroll-margin-top:calc(var(--upload-head,64px) + 80px)}
@media(max-width:380px){#upload-page .upload-actions{gap:6px}#upload-page .upload-actions .btn{padding-inline:10px;font-size:15px}}
/* 拍题: photo, circle, next photo, upload all.
   Before the first photo: the three steps, and the camera as the one coloured button. */
.flow-steps {display:flex;flex-wrap:wrap;align-items:center;gap:6px 5px;margin:0;padding:0;list-style:none;counter-reset:flow;font-size:15px;font-weight:650}
.flow-steps li {counter-increment:flow;display:inline-flex;align-items:center;gap:5px;white-space:nowrap}
.flow-steps li::before {content:counter(flow);flex:none;width:22px;height:22px;border-radius:50%;background:var(--pine);color:#fffdf1;font-size:13px;font-weight:750;line-height:22px;text-align:center}
.flow-steps li:not(:last-child)::after {content:"→";margin-left:1px;color:var(--muted);font-weight:400}
#upload-page .study-start {grid-template-columns:repeat(2,minmax(0,1fr))}
.study-start .pick {justify-content:center;min-width:0;padding:11px 6px;gap:6px;font-size:15px}
.study-start .pick-primary {grid-column:1/-1;min-height:60px;font-size:18px;border:2px solid #8a4b12;background:#f7a935;color:#2e1a04;font-weight:750;box-shadow:0 2px 0 #8a4b12}
.study-start .pick-primary:hover {background:#fabb5c}
.study-start .pick-primary:active {background:#ea982a;box-shadow:none}
.study-start .pick-primary .icon {width:26px;height:26px}
/* With a photo on the page the two model cards share one row, so the photo stays on the first screen. */
.tier-compact {gap:6px}
.tier-compact legend {margin-bottom:6px;font-size:15px}
.tier-compact .tier-options {grid-template-columns:1fr 1fr;gap:8px}
.tier-compact .tier-card {min-height:0;padding:10px 11px;gap:4px}
.tier-compact .tier-card::before {left:11px;top:12px;width:14px;height:14px}
.tier-compact .tier-card b {padding-left:26px;font-size:17px}
.tier-compact .tier-option input:checked + .tier-card::before {background:radial-gradient(circle,var(--tier-accent) 0 4px,#fff 5px)}
.tier-compact .tier-card .tier-tagline {font-size:13px;line-height:1.45}
.tier-compact .tier-strong .tier-tagline {padding:3px 6px}
.tier-compact .tier-card small {display:none}
@media(min-width:700px){.tier-compact .tier-card{padding:12px 14px;gap:6px}.tier-compact .tier-card small{display:block}}
/* The row that stays under the page header: clear the circle, take the next photo, upload everything; and what to do next. */
#upload-page .study-actions {display:grid;gap:7px}
.study-buttons {display:flex;align-items:stretch;gap:8px;min-width:0}
.study-buttons .btn {white-space:nowrap;padding-inline:12px}
.study-buttons .clear-circle {flex:0 0 auto}
.study-buttons .shoot-next {flex:1 1 0}
.study-buttons .btn.primary {flex:1.25 1 0}
.shoot-next {position:relative;cursor:pointer;background:#f7a935;border:2px solid #8a4b12;color:#2e1a04;font-weight:750;box-shadow:0 2px 0 #8a4b12}
.shoot-next:hover {background:#fabb5c}
.shoot-next:active {background:#ea982a;box-shadow:none}
.shoot-next input[type=file] {position:absolute;inset:0;width:100%;height:100%;margin:0;opacity:0;cursor:pointer}
.shoot-next:focus-within {outline:3px solid var(--ink);outline-offset:2px}
.shoot-next.shoot-wait {background:#fff8ea;border-color:#c9a36a;color:#6b4a1a;font-weight:650;box-shadow:none}
.shoot-next.pick-full {opacity:.5;cursor:not-allowed;box-shadow:none}
.shoot-next.pick-full input {cursor:not-allowed}
.circle-status {display:flex;align-items:center;gap:9px;min-height:30px;color:#ad2624}
.circle-status::before {content:"";flex:none;width:10px;height:10px;margin-left:3px;border-radius:50%;background:#d0352b;box-shadow:0 0 0 3px #d0352b33}
/* The line that says what to do next keeps the hand-written look the circling hint has always had. */
.circle-status p {flex:1;min-width:0;margin:0;font:400 1.1rem/1.45 ZhitiHappy,"PingFang SC","Microsoft YaHei",sans-serif}
.circle-status.circle-ready {color:#1a5635}
.circle-status.circle-ready::before {background:#2f8a57;box-shadow:0 0 0 3px #2f8a5733}
#upload-page .circle-status .circle-jump {flex:none;min-height:36px;padding:4px 14px;border:2px solid #b82b25;border-radius:18px;background:#b82b25;color:#fff;font-size:14px;font-weight:750}
@media(max-width:480px){
  #upload-page .study-buttons .btn {padding-inline:8px;gap:5px;font-size:15px}
  .study-buttons .clear-circle .icon,.study-buttons .btn.primary .icon {display:none}
  .circle-status p {font-size:1.02rem}
}
/* The narrowest phones: the clear button keeps only its cross, so the three still share one row. */
@media(max-width:350px){
  .study-buttons .clear-circle {flex:0 0 46px;padding-inline:0}
  .study-buttons .clear-circle .icon {display:block}
  .study-buttons .clear-circle span,.study-buttons .shoot-next .icon {display:none}
  #upload-page .study-buttons .btn {font-size:14px}
}
/* A phone on its side is short: the buttons and the line beside them share one row. */
@media(max-height:520px) and (min-width:560px){
  #upload-page .study-actions {grid-template-columns:minmax(0,1.3fr) minmax(0,1fr);align-items:center;column-gap:14px}
  #upload-page .study-actions #prepare-original {grid-column:1/-1}
}
/* One small picture per photo: its number, and whether it has its circle. */
.photo-strip {display:flex;gap:8px;overflow-x:auto;padding:4px 3px 6px;scroll-snap-type:x proximity;-webkit-overflow-scrolling:touch}
.strip-item {position:relative;flex:none;width:62px;height:62px;padding:0;border:2px solid #c7493f;border-radius:10px;background:#f1e9e2;overflow:hidden;scroll-snap-align:start;cursor:pointer}
.strip-item img {display:block;width:100%;height:100%;object-fit:cover}
.strip-item b {position:absolute;left:3px;top:3px;min-width:20px;height:20px;padding:0 5px;border-radius:10px;background:#173e31e6;color:#fff;font-size:13px;line-height:20px;text-align:center}
.strip-mark {position:absolute;right:0;bottom:0;left:0;padding:1px 0;background:#c7352be6;color:#fff;font-size:12px;font-weight:750;line-height:17px;text-align:center}
.strip-item.circled {border-color:#2f8a57}
.strip-item.circled .strip-mark {background:#23774ae6}
.strip-item.current {outline:3px solid #f0a63a;outline-offset:1px}
/* The photo being circled: its number and state above it; under it, how to see better, its size, and the small button that removes it. */
.crop-title.study-title {align-items:center;flex-wrap:wrap;gap:6px 10px}
.study-title strong {font-size:17px;white-space:nowrap}
.study-title small {margin-left:6px;color:var(--muted);font-size:13px;font-weight:400}
.study-title #crop-status {padding:3px 10px;border-radius:13px;background:#fde8e3;color:#9c2018;font-weight:750}
.study-title #crop-status.circled {background:#e1f1e3;color:#1a5635}
.study-photo .zoom-hint {margin:0}
.photo-foot {display:flex;align-items:center;justify-content:space-between;flex-wrap:wrap;gap:6px 12px}
.photo-foot .upload-size {flex:1 1 180px;margin:0;font-size:12px}
.crop-editor .btn.remove-photo {flex:none;justify-self:auto;min-height:36px;padding:4px 12px;border-color:#dcbdb6;background:#fffaf7;color:#7a2a22;font-size:14px}
/* A tablet has the room for a larger photo to circle on. */
@media(min-width:700px) and (min-height:900px){.study-photo .crop-board img{max-height:min(52vh,640px);max-height:min(52dvh,640px)}}
#upload-page .study-additions .upload-more-choices {grid-template-columns:1fr}
#upload-page .study-start .pick[data-source=album] {grid-column:1/-1}
#prepare-original:empty {display:none}
#upload-page.transfer-page {display:flex;flex-direction:column;min-height:100vh;min-height:100dvh;background:var(--cream)}
.transfer-page .sheet-body {
  flex:1;place-items:center;align-content:center;
  padding:24px max(16px,env(safe-area-inset-right)) max(24px,env(safe-area-inset-bottom)) max(16px,env(safe-area-inset-left));
}
.transfer-card {
  width:min(100%,26rem);min-width:0;text-align:center;padding:clamp(22px,6vw,36px);
  border:1px solid var(--line);border-radius:18px;background:var(--card);
  box-shadow:0 8px 28px rgba(28,73,52,.06);
}
.transfer-symbol {
  display:grid;place-items:center;width:56px;height:56px;border-radius:17px;
  margin:0 auto 16px;color:var(--pine);background:#e8f0e5;
}
.transfer-symbol .icon {width:29px;height:29px}
.transfer-card h2 {margin:0;font-size:clamp(1.25rem,4.8vw,1.55rem);line-height:1.35}
#upload-progress-detail {margin:8px 0 24px;color:var(--muted);font-size:.91rem;line-height:1.55;overflow-wrap:anywhere}
#upload-progress {text-align:left}
.crop-editor {display:grid;gap:10px;min-width:0}
.crop-title {display:flex;align-items:baseline;justify-content:space-between;gap:12px}
.crop-title strong {overflow-wrap:anywhere}
#crop-status {color:#32604d;font-size:.82rem;white-space:nowrap}
.crop-board {position:relative;max-width:100%;line-height:0;align-self:center;user-select:none;-webkit-user-select:none;-webkit-touch-callout:none}
.crop-board img {display:block;width:auto;height:auto;max-width:100%;max-height:min(48vh,420px);max-height:min(48dvh,420px);pointer-events:none}
#crop-overlay {position:absolute;inset:0;width:100%;height:100%;touch-action:none;cursor:crosshair}
.crop-outline {fill:none;stroke:#e94132;stroke-width:3;stroke-linecap:round;stroke-linejoin:round;vector-effect:non-scaling-stroke}
.crop-editor .btn {justify-self:start;min-height:42px}
