/* Main application shell. The map canvas and its gestures keep their original styles. */
body.workspace {
 --paper: #edf2ea;
 --green: #295a48;
 --ink: #20382f;
 --muted: #53685e;
 --line: #d8e2d8;
 --surface: #fffefb;
 --shadow: 0 16px 32px -26px #213d3252, 0 1px 3px #213d3208;
 min-height: 100vh;
 background: radial-gradient(ellipse at 18% 0%, #fbf8ed 0, transparent 58%), linear-gradient(160deg,#f5f7f1,#edf2ec);
 color: var(--ink);
 font-family: system-ui, "Microsoft JhengHei", sans-serif;
}

.workspace-header { display: block; padding: 0; background: #fffefbf7; border-bottom: 1px solid var(--line); }
.workspace-bar { max-width: 1312px; margin: auto; min-height: 66px; padding: 8px clamp(16px,4vw,50px); display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.workspace-bar nav { display: flex; align-items: center; justify-content: flex-end; flex-wrap: wrap; gap: 3px clamp(6px,1.7vw,22px); }
.workspace-bar nav > a, .workspace-bar .plain { font-size: 13px; color: var(--green); text-decoration: none; white-space: nowrap; }
.workspace-bar nav > a { padding: 10px 0; }
.wordmark { display: inline-flex; align-items: center; gap: 9px; color: var(--ink); text-decoration: none; font-size: 18px; font-weight: 760; white-space: nowrap; }
.brand-icon { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 9px; background: #dce9d9; color: var(--green); font-size: 17px; }
.workspace .workspace-main { max-width: 1312px; padding: clamp(26px,5vw,64px) clamp(15px,4vw,50px) 20px; }
.workspace footer { margin: 36px 0 6px; font-size: 12px; color: #566b62; }
.workspace h1 { font-weight: 760; letter-spacing: -.04em; }
.workspace .surface { background: var(--surface); border: 1px solid var(--line); border-radius: 18px; box-shadow: var(--shadow); min-width: 0; }
.workspace button.primary { background: #285d4b; border-color: #285d4b; border-radius: 10px; font-weight: 660; min-height: 46px; padding: 10px 18px; }
.workspace button.primary:hover { background: #204b3e; }
.workspace button.plain, .workspace button.back-link { border-color: transparent; background: transparent; color: var(--green); font-weight: 660; }
.workspace button.plain:hover, .workspace button.back-link:hover { background: #e4ece0; }
.workspace :focus-visible { outline: 2px solid #356f59; outline-offset: 3px; }
.workspace h1:focus, .workspace section[tabindex="-1"]:focus { outline: 0; }

.login-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr); max-width: 970px; margin: clamp(8px,4vh,42px) auto 0; min-height: 430px; overflow: hidden; }
.login-content { align-self: center; padding: clamp(26px,6vw,70px); }
.login-content h1 { margin: 0 0 12px; font-size: clamp(36px,4.4vw,56px); }
.login-content p { margin: 0 0 24px; color: var(--muted); }
.login-content label { color: var(--muted); font-size: 14px; font-weight: 670; }
.login-content input { min-height: 50px; margin: 6px 0 12px; font-variant-numeric: tabular-nums; }
.login-content .primary { width: 100%; display: flex; justify-content: space-between; align-items: center; }
.login-content .feedback { margin: 12px 0 0; }
.login-art { min-height: 290px; background: radial-gradient(ellipse at 55% 20%, #fdedc733, transparent 65%), linear-gradient(150deg,#263e2b1f,#142d2770), url('/maps/7.webp') center 52% / cover; }

.page-heading { display: flex; align-items: end; justify-content: space-between; gap: 14px; margin: 8px 0 22px; }
.page-heading h1 { margin: 0 0 4px; font-size: clamp(30px,4.3vw,44px); line-height: 1.15; }
.page-heading p { margin: 0; overflow-wrap: anywhere; font-size: 13px; font-variant-numeric: tabular-nums; }
.sync-strip { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 14px; padding: clamp(16px,3vw,24px); }
.sync-label { margin: 0 0 2px; font-size: 13px; color: var(--muted); }
#last-read { margin: 0; font-weight: 670; font-variant-numeric: tabular-nums; }
.destination-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: clamp(12px,2.5vw,24px); margin-top: 22px; }
.workspace .destination { display: flex; justify-content: space-between; align-items: end; gap: 12px; padding: clamp(16px,3vw,32px); min-height: clamp(145px,20vw,218px); text-align: left; border-radius: 20px; box-shadow: var(--shadow); position: relative; overflow: hidden; isolation: isolate; }
.destination-label { display: grid; min-width: 0; gap: 4px; }
.destination strong { font-size: clamp(23px,3vw,34px); line-height: 1.2; }
.destination small { font-size: 13px; line-height: 1.5; color: #fffdf2; }
.destination-arrow {
 display: grid; place-items: center; width: 38px; height: 38px; flex: 0 0 38px;
 border: 1px solid #ffffff56; border-radius: 50%; background: #ffffff19; font-size: 20px;
}
.workspace .destination-map { background: linear-gradient(90deg,#173d35ed,#213e3270),url('/maps/6.webp') center 48% / cover; color: #fffdf2; border-color: #386558; }
.workspace .destination-stock {
 background: linear-gradient(90deg,#222f22d9 0%,#26332671 51%,transparent 85%),
  linear-gradient(0deg,#222b22a6,transparent 55%), url('/assets/stock-cover.webp') center 58% / cover #303c2d;
 color: #fffdf2; border-color: #48563d;
}
.workspace .destination:hover { filter: brightness(1.055); }
.workspace .back-link { padding: 8px 10px; margin-left: -10px; }
.feedback { margin: 12px 0 0; padding: 10px 13px; border: 1px solid #cfe4d2; background: #e6f2e7; color: #244f3b; border-radius: 10px; font-size: 14px; }
.feedback[data-error="true"] { border-color: #edd0c8; background: #fff0e9; color: #823d2b; }

.binding-panel { max-width: 760px; padding: clamp(16px,3vw,30px); }
.binding-panel p, .binding-panel li { line-height: 1.65; }
.binding-panel h2 { font-size: clamp(21px,2.8vw,27px); }
.binding-steps { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); list-style: none; gap: 4px; padding: 5px; margin: 0 0 24px; border-radius: 12px; background: #eff4ee; }
.binding-steps li { min-width: 0; }
.binding-steps button { width: 100%; min-height: 44px; padding: 8px 4px; text-align: center; border: 1px solid transparent; border-radius: 8px; background: transparent; font-size: 13px; color: var(--muted); }
.binding-steps button:enabled:hover { background: #e5efe4; }
.binding-steps button[aria-current="step"] { background: var(--surface); border-color: #cedbce; color: var(--green); font-weight: 730; box-shadow: 0 1px 3px #243e2911; }
.binding-steps button:disabled { opacity: .65; cursor: default; }
.binding-panel h2:focus { outline: 0; }
.binding-panel h2 { margin: 0 0 10px; }
.binding-panel ol:not(.binding-steps) { padding-left: 24px; }
.binding-panel ol:not(.binding-steps) li { margin: 7px 0; }
.binding-details { border: 1px solid var(--line); border-radius: 10px; padding: 9px 12px; margin: 12px 0; }
.binding-details summary { cursor: pointer; color: var(--green); font-weight: 620; }
.binding-details label { margin-top: 10px; }
.binding-details pre { white-space: pre-wrap; overflow-wrap: anywhere; }
.binding-details a { color: var(--green); }
#bind-form > .actions { margin-top: 8px; }
.check-line { display: flex; align-items: center; gap: 8px; min-height: 35px; }
.check-line input { flex: 0 0 auto; width: 17px; height: 17px; margin: 0; accent-color: var(--green); }

.workspace .maps { gap: clamp(12px,2.2vw,24px); }
.workspace .map-card { border-radius: 16px; box-shadow: var(--shadow); }
.workspace .record-panel { box-shadow: var(--shadow); }
@media(max-width: 640px) {
 .workspace-bar { min-height: 58px; padding-inline: 12px; }
 .workspace-bar nav > a, .workspace-bar button.plain { font-size: 12px; }
 .workspace-bar button.plain { padding: 7px 5px; }
 .wordmark { font-size: 15px; gap: 5px; }
 .brand-icon { width: 22px; height: 22px; border-radius: 7px; }
 .login-layout { grid-template-columns: minmax(0,1fr); max-width: 420px; min-height: auto; }
 .login-content { padding: 25px 22px; }
 .login-art { min-height: 120px; }
 .destination-grid { margin-top: 15px; }
 .workspace .destination { min-height: 130px; border-radius: 14px; }
 .destination-arrow { width: 31px; height: 31px; flex-basis: 31px; font-size: 18px; }
 .destination small { font-size: 12px; }
}
@media(max-width: 508px) {
 .destination-grid { grid-template-columns: minmax(0,1fr); }
 .workspace .destination { min-height: 139px; }
}
@media(max-width: 365px) {
 .workspace-bar nav { gap: 2px 4px; }
}

.snapshot-times { display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); gap: 12px 22px; margin: 0; flex: 1 1 620px; }
.snapshot-times > div { min-width: 0; }
.snapshot-times dt { font-size: 12px; color: var(--muted); }
.snapshot-times dd { margin: 1px 0 0; font-weight: 680; font-variant-numeric: tabular-nums; }
.workspace .sync-strip { align-items: end; }
.binding-steps { grid-template-columns: repeat(4,minmax(0,1fr)); }
.store-links a { display: inline-flex; align-items: center; padding: 9px 13px; min-height: 42px; border-radius: 9px; border: 1px solid var(--line); text-decoration: none; color: var(--green); font-weight: 650; }
.store-links a:hover { background: #e7f0e7; }
.host-list { display: grid; gap: 7px; margin: 15px 0; }
.host-list > div { display: flex; align-items: center; justify-content: space-between; gap: 6px 10px; padding: 7px 10px; border: 1px solid var(--line); background: #f3f7ef; border-radius: 8px; }
.host-list code { overflow-wrap: anywhere; font-size: 13px; }
.host-list button { flex-shrink: 0; padding: 5px 10px; }
.track-cover { width: 55px; height: 55px; flex: 0 0 auto; display: grid; place-items: center; border-radius: 8px; overflow: hidden; background: #e4eee1; color: #285d4b; }
.track-cover img { width: 100%; height: 100%; object-fit: cover; }
.track-cover .music-icon { font-size: 19px; }
.workspace #map-filters { position: relative; background: var(--surface); border: 1px solid var(--line); padding: clamp(10px,2vw,17px); border-radius: 16px; box-shadow: var(--shadow); }
.workspace #map-filters .map-toggles { margin: 0 0 10px; }
@media(max-width: 550px) {
 .snapshot-times { grid-template-columns: repeat(2,minmax(0,1fr)); gap: 9px 12px; }
 .snapshot-times > div:nth-child(3) { grid-column: 1/-1; }
 .snapshot-times dd { font-size: 13px; }
 .binding-steps button { font-size: 12px; }
}
