/* Shared outer frame and introduction gutters. Preserve all form controls and stages. */
@media screen {
 body.jr-entry.sp-system{margin:0;background:var(--sp-outside)}
 .jr-entry #jg-records.sp-app-shell{width:100%;max-width:480px;margin-inline:auto;padding:0;background:#241e1b}
 .jr-entry #jg-records .jg-app{max-width:100%}
 .jr-entry .saved-reading-link{max-width:480px;margin-inline:auto}
 .jr-entry #jg-records .jg-cinema{width:100%}
 /* Match Honsarok's outer-edge inset (1px border + 28px padding) without adding a border. */
 .jr-entry #jg-records .jg-cinema :is(.jg-entry,.jg-greeting){left:29px;right:29px}
 .jr-entry #jg-records .jg-cinema .jg-cream{width:100%;max-width:none;min-width:0}
 .jr-entry #jg-records .jg-cinema .jg-entry{top:55%;bottom:auto}
 .jr-entry #jg-records .jg-cinema .jg-knock{width:auto;max-width:100%;min-width:0;min-height:54px;padding:13px 30px;border:1px solid #e8d1aeaa;border-radius:4px;background:#291916b3;color:#fff4e2;font-size:19px;line-height:1.5;letter-spacing:.035em}
 .jr-entry #jg-records .jg-cinema .jg-knock:hover:not(:disabled){background:#4a2c27}
 .jr-entry #jg-records .jg-cinema .jg-knock:focus-visible{outline:2px solid #fff4e2;outline-offset:4px}
}
@media screen and (max-width:360px) {
 .jr-entry #jg-records .jg-cinema :is(.jg-entry,.jg-greeting){left:23px;right:23px}
}

/* A narrow form should not stretch to the full height of a tall desktop window. */
@media screen {
 .jr-entry #jg-records:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]){height:min(var(--jg-viewport-height,100dvh),880px)}
 .jr-entry #jg-records .jg-panel-content :is(legend,.jg-self-name,.jg-unknown){font-size:14px;line-height:1.6}
 .jr-entry #jg-records .jg-panel-content :is(select,input[name="selfName"],input[name="partnerName"]){font-size:16px;min-height:52px}
 .jr-entry #jg-records .jg-panel-content .jg-calendar:not(.jg-calendar-inline) label span{font-size:15px;min-height:44px}
 .jr-entry #jg-records .jg-panel-content :is(small,.jg-calendar-help){font-size:12px;line-height:1.6}
 .jr-entry #jg-records .jg-panel-actions button{font-size:16px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-guide{margin-top:clamp(8px,calc(var(--jg-viewport-height,100dvh) - 690px),48px)}
}
@media screen {
 .jr-entry:has(#jg-records:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]))>.saved-reading-link{display:none}
}

/* A quiet paper background keeps every input stage focused on the question. */
@media screen {
 .jr-entry #jg-records .jg-paper{background:#e9e0d4;color:#3b302b}
 .jr-entry #jg-records .jg-paper .jg-paper-logo{color:#754653}
 .jr-entry #jg-records .jg-paper .jg-page{color:#78695e}
 .jr-entry #jg-records .jg-paper .jg-guide p{color:#3b302b;text-shadow:none}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-guide{margin-top:16px}
}

.jr-return-dialog{box-sizing:border-box;width:calc(100% - 40px);max-width:420px;margin:auto;border:1px solid #d5c7b6;border-radius:16px;padding:35px 28px 20px;background:#f7f1e7;color:#3b302b;font-family:inherit;text-align:center;box-shadow:0 18px 70px #180f0d40}
.jr-return-dialog::backdrop{background:#211c1980}
.jr-return-dialog .jr-return-close{position:absolute;right:10px;top:8px;width:40px;height:40px;border:0;background:transparent;color:#75675c;font-size:26px;cursor:pointer}
.jr-return-dialog .jr-return-eyebrow{margin:0 0 18px;color:#78444e;font-size:12px;letter-spacing:.08em}
.jr-return-dialog h2{font-size:24px;font-weight:400;line-height:1.5;margin:0 0 14px}
.jr-return-dialog #jr-return-description{font-size:15px;line-height:1.9;margin:0 0 26px;word-break:keep-all}
.jr-return-dialog .jr-return-continue,.jr-return-dialog .jr-return-new{display:block;width:100%;min-height:52px;border:0;font:inherit;font-size:16px;cursor:pointer;border-radius:4px}
.jr-return-dialog .jr-return-continue{background:#754653;color:#fff8ec}
.jr-return-dialog .jr-return-new{margin-top:6px;background:transparent;color:#78695e;font-size:14px}
.jr-return-dialog button:focus-visible{outline:2px solid #754653;outline-offset:3px}
.jr-return-dialog .jr-return-continue:disabled{opacity:.6;cursor:wait}
.jr-return-dialog .jr-return-error{font-size:13px;line-height:1.7;color:#a13a32;margin:0 0 18px}
@media(max-width:600px){.jr-return-dialog{width:100%;max-width:480px;margin:auto auto 0;border-radius:20px 20px 0 0;border-bottom:0;padding:32px 24px max(18px,env(safe-area-inset-bottom))}}

/* Fixed action row; only the content area scrolls inside the input sheet. */
@media screen {
 body.jr-entry:has(#jg-records:is([data-scene="form"],[data-scene="questions"],[data-scene="review"])){overflow:hidden;overscroll-behavior:none}
 .jr-entry #jg-records:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]){position:fixed;inset-inline:0;top:var(--jg-viewport-top,0px);height:min(var(--jg-viewport-height,100dvh),880px);min-height:0;margin-inline:auto}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]){height:100%;min-height:0;overflow:hidden}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper{height:100%;min-height:0;overflow:hidden;padding:0}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-conversation-portrait{position:relative;inset:auto;flex:1 0 0;width:100%;height:auto;min-height:clamp(160px,calc(var(--jg-viewport-height,100dvh)*.28),290px);aspect-ratio:auto;overflow:hidden}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-conversation-portrait img{position:absolute;inset:0;display:block;width:100%;height:100%;object-fit:cover;object-position:50% 12%;opacity:1}
 .jr-entry #jg-records .jg-conversation-portrait:after{background:linear-gradient(180deg,#211c1938 0%,transparent 22%,transparent 65%,#e9e0d408 70%,#e9e0d420 76%,#e9e0d45c 84%,#e9e0d4bf 93%,#e9e0d4 100%);pointer-events:none}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper header{position:absolute;top:0;left:0;right:0;z-index:1;padding:14px 22px}
 .jr-entry #jg-records .jg-paper .jg-paper-logo,.jr-entry #jg-records .jg-paper .jg-page{color:#fff4e5;text-shadow:0 1px 6px #211c1980}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-guide{display:block;flex:none;margin:8px 22px 14px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-guide p{font-size:19px;line-height:1.6}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper :is(form,.jg-review){display:flex;flex:0 1 auto;min-height:0;margin:0 12px;border-radius:14px 14px 0 0;overflow:hidden;box-shadow:0 -3px 18px #5e43310b}
 .jr-entry #jg-records .jg-panel-content{flex:0 1 auto;min-height:0;overflow-y:auto;overscroll-behavior-y:contain;scroll-padding:18px;padding:18px 18px 10px;-webkit-overflow-scrolling:touch;scrollbar-width:thin}
 .jr-entry #jg-records .jg-paper .jg-panel-actions{flex:none;position:relative;padding:12px 18px max(14px,env(safe-area-inset-bottom));border-top:0;box-shadow:none}
 .jr-entry #jg-records [data-can-scroll-bottom="true"]>.jg-panel-actions{box-shadow:0 -12px 20px -12px #4f352e55}
 .jr-entry #jg-records .jg-app[data-scene="analysis"] .jg-conversation-portrait{display:none}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app .jg-conversation-portrait{flex:none;min-height:0;height:60px}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app .jg-guide{margin:6px 20px 10px}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app .jg-guide p{font-size:16px;line-height:1.45;white-space:normal}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app .jg-paper :is(form,.jg-review){flex:1 1 auto}
 .jr-entry #jg-records[data-keyboard="true"] .jg-panel-content{flex:1 1 auto}
 .jr-entry #jg-records[data-keyboard="true"] .jg-paper .jg-panel-actions{padding-bottom:10px;padding-top:8px}
}
@media screen and (max-height:600px){
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-conversation-portrait{flex:none;min-height:0;height:64px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-guide{margin:4px 20px 10px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-guide p{font-size:16px;line-height:1.4;white-space:normal}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper :is(form,.jg-review){flex:1 1 auto}
 .jr-entry #jg-records .jg-panel-content{flex:1 1 auto}
}

/* With a keyboard or landscape viewport, trade the portrait for usable input space. */
@media screen {
 .jr-entry #jg-records[data-keyboard="true"] .jg-app .jg-conversation-portrait{height:0;min-height:0;flex:none}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app .jg-paper header{position:relative;flex:none;padding:10px 20px 4px}
 .jr-entry #jg-records[data-keyboard="true"] .jg-paper :is(.jg-paper-logo,.jg-page){color:#754653;text-shadow:none}
}
@media screen and (max-height:600px){
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-conversation-portrait{height:0;min-height:0;flex:none}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper header{position:relative;flex:none;padding:10px 20px 4px}
 .jr-entry #jg-records .jg-paper :is(.jg-paper-logo,.jg-page){color:#754653;text-shadow:none}
}

/* Mobile input and preparation are full pages, without a portrait or modal frame. */
@media screen and (max-width:600px), screen and (max-width:960px) and (max-height:600px) {
 body.jr-entry:has(#jg-records:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"])){background:#f4efe6;overflow:hidden;overscroll-behavior:none}
 .jr-entry #jg-records:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]){position:fixed;inset-inline:0;top:var(--jg-viewport-top,0px);width:100%;max-width:none;height:var(--jg-viewport-height,100dvh);min-height:0;padding:0;background:#f4efe6}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]){height:100%;min-height:0;overflow:hidden}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper{display:flex;flex-direction:column;height:100%;min-height:0;padding:0;overflow:hidden;background:#f4efe6;animation:none}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-conversation-portrait{display:none}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper header{display:flex;position:relative;flex:none;inset:auto;padding:max(20px,env(safe-area-inset-top)) 24px 12px}
 .jr-entry #jg-records .jg-paper .jg-paper-logo{color:#754653;text-shadow:none}
 .jr-entry #jg-records .jg-paper .jg-page{color:#78695e;text-shadow:none}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-guide{display:block;flex:none;margin:22px 24px 18px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-guide p{font-size:22px;line-height:1.55;color:#3b302b}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper :is(form,.jg-review){flex:1 1 0;min-height:0;margin:0;padding:0;border:0;border-radius:0;box-shadow:none;background:transparent}
 .jr-entry #jg-records .jg-panel-content{flex:1 1 0;padding:12px 24px 18px}
 .jr-entry #jg-records .jg-paper .jg-panel-actions{padding:14px 24px max(16px,env(safe-area-inset-bottom));background:#f4efe6}
 .jr-entry #jg-records .jg-app[data-scene="analysis"] .jg-analysis{flex:1 1 0;min-height:0;margin:0;padding:12px 24px max(24px,env(safe-area-inset-bottom));overflow-y:auto;overscroll-behavior:contain;border:0;border-radius:0;box-shadow:none;background:transparent}
 .jr-entry #jg-records .jg-analysis-steps li{padding:18px 0}
 .jr-entry #jg-records .jg-analysis-steps b{font-size:16px}
 .jr-entry #jg-records .jg-analysis-steps small{font-size:13px;line-height:1.7}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper header{padding-top:10px;padding-bottom:6px}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-guide{margin:6px 24px 8px}
 .jr-entry #jg-records[data-keyboard="true"] .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-guide p{font-size:16px;line-height:1.4}
}
@media screen and (max-width:960px) and (max-height:600px){
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper header{padding-top:10px;padding-bottom:6px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-guide{margin:8px 24px 10px}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"],[data-scene="analysis"]) .jg-paper .jg-guide p{font-size:18px;line-height:1.45;white-space:normal}
 .jr-entry #jg-records .jg-analysis-steps li{padding:12px 0}
}

/* One consistent back action in the input header; progress labels are omitted. */
.jr-entry #jg-records .jg-paper .jg-page{display:none}
.jr-entry #jg-records .jg-paper header{justify-content:flex-start;gap:4px}
.jr-entry #jg-records .jg-header-back{display:grid;place-items:center;flex:none;width:44px;height:44px;margin-left:-12px;padding:0;border:0;border-radius:4px;background:transparent;color:#fff4e5;cursor:pointer}
.jr-entry #jg-records .jg-header-back:focus-visible{outline:2px solid currentColor;outline-offset:2px}
.jr-entry #jg-records .jg-paper .jg-panel-actions :is(.jg-back,.jg-question-back){display:none}
.jr-entry #jg-records[data-keyboard="true"] .jg-header-back{color:#754653}
@media screen and (max-width:600px), screen and (max-width:960px) and (max-height:600px){
 .jr-entry #jg-records .jg-header-back{color:#754653}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper header{padding-top:max(8px,env(safe-area-inset-top));padding-bottom:0}
 .jr-entry #jg-records .jg-app:is([data-scene="form"],[data-scene="questions"],[data-scene="review"]) .jg-paper .jg-guide{margin-top:16px}
 /* The preparation heading already explains the state; free the whole viewport for its steps. */
 .jr-entry #jg-records .jg-app[data-scene="analysis"] .jg-paper :is(header,.jg-guide){display:none}
 .jr-entry #jg-records .jg-app[data-scene="analysis"] .jg-analysis{padding:max(28px,env(safe-area-inset-top)) 24px max(24px,env(safe-area-inset-bottom))}
 .jr-entry #jg-records .jg-analysis-heading h2{font-size:20px;line-height:1.5;word-break:keep-all}
 .jr-entry #jg-records .jg-analysis-percent{flex:none}
 .jr-entry #jg-records .jg-analysis-steps li{padding:14px 0}
 .jr-entry #jg-records .jg-analysis-steps small{font-size:13px;line-height:1.6}
}
@media screen and (max-height:600px){.jr-entry #jg-records .jg-header-back{color:#754653}}
