/* Homepage. Explicit block text prevents NiceGUI labels collapsing vertical spacing. */
.home-page{width:100%;padding:25px 0 20px}
.home-hero{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);gap:64px;align-items:center}
.home-intro{min-width:0;padding:12px 0}
.home-eyebrow{display:block;color:#31776c;font-size:10px;font-weight:650;letter-spacing:.17em;text-transform:uppercase;margin-bottom:22px}
.home-title{font-size:clamp(36px,4vw,49px);font-weight:620;line-height:1.14;letter-spacing:-1.9px;margin:0 0 23px;white-space:pre-line;overflow-wrap:break-word;text-wrap:balance}
.home-title .nicegui-label{font:inherit;letter-spacing:inherit;line-height:inherit}
.home-lead{font-size:18px;font-weight:450;line-height:1.6;color:#365b52;max-width:440px;margin:0 0 19px}
.home-intro-text{font-size:14px;line-height:1.85;color:var(--rk-muted);max-width:440px;margin:0 0 25px}
.home-lead .nicegui-label,.home-intro-text .nicegui-label{font:inherit;color:inherit}
.home-intro>.home-subjects{display:block;font-weight:650;color:var(--rk-muted);font-size:11px;line-height:1.7;margin:17px 0 0;max-width:440px;}
.home-create{display:inline-flex;align-items:center;justify-content:center;gap:10px;background:var(--rk-brand);color:#07332e!important;min-height:44px;padding:0 16px;border-radius:10px;font-size:13px;font-weight:650;text-decoration:none;transition:background .15s}
.home-create:hover{background:#38b5a8}
.home-lookup{background:white;border:1px solid #d4e2dc;border-radius:21px;padding:31px;min-width:0}
.home-lookup-heading{display:flex;align-items:center;justify-content:space-between;gap:15px;margin-bottom:13px}
.home-lookup-icon{display:flex;align-items:center;justify-content:center;width:43px;height:43px;background:#ecf6f2;color:#278c7e;border-radius:12px;flex-shrink:0}
.home-lookup-title{font-size:24px;font-weight:600;letter-spacing:-.6px;line-height:1.3;margin:0}
.home-lookup-title .nicegui-label{font:inherit;letter-spacing:inherit}
.home-lookup-intro{display:block;font-size:13px;line-height:1.7;color:var(--rk-muted);margin-bottom:24px}
.home-code-input{width:100%;margin-bottom:15px}
.home-code-input .q-field__control{min-height:66px;border-radius:10px!important;background:#fbfdfc}
.home-code-input .q-field__control:before{border-color:#cddbd5}
.home-code-input .q-field__native{font-family:ui-monospace,SFMono-Regular,monospace;font-size:21px;letter-spacing:.15em;line-height:1.5}
.home-code-input input::placeholder{color:#8ba299;opacity:.8}
.home-code-input .q-field__label{font-size:11px;letter-spacing:.04em;color:#647f75}
.home-code-input .q-field__bottom{display:none}
.home-open-button{width:100%;min-height:49px!important;border-radius:10px!important;background:var(--rk-deep)!important;color:white!important;box-shadow:none!important;text-transform:none!important;font-weight:600;font-size:13px}
.home-open-button .q-btn__content{flex-direction:row-reverse;gap:12px}
.home-open-button:hover{background:#22564e!important}
.home-code-help{display:block;color:var(--rk-muted);font-size:11px;line-height:1.7;margin-top:12px}
.home-error{display:block;color:#ac3829;font-size:12px;line-height:1.6;margin:-4px 0 14px}
.home-scan-tip{display:flex;gap:10px;align-items:flex-start;padding-top:19px;margin-top:22px;border-top:1px solid #e7eeea;font-size:11px;line-height:1.7;color:var(--rk-muted)}
.home-scan-tip .q-icon{flex-shrink:0;margin-top:1px;color:#69958a}
.home-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:20px;margin-top:38px;padding-top:26px;border-top:1px solid var(--rk-line)}
.home-shortcut{display:flex;align-items:center;gap:17px;min-width:0;padding:22px;background:transparent;border:1px solid transparent;border-radius:14px;color:var(--rk-ink)!important;text-decoration:none;transition:border-color .15s,background .15s}
.home-shortcut:hover{background:white;border-color:var(--rk-line)}
.home-shortcut-icon{display:flex;align-items:center;justify-content:center;color:#337f72;width:43px;height:43px;background:#e5f0eb;border-radius:12px;flex-shrink:0}
.home-shortcut-content{flex:1;min-width:0}
.home-shortcut h2{font-size:14px;font-weight:600;line-height:1.4;margin:0 0 5px;letter-spacing:-.15px}
.home-shortcut h2 .nicegui-label{font:inherit}
.home-shortcut-description{font-size:12px;line-height:1.7;color:var(--rk-muted)}
.home-shortcut-arrow{flex-shrink:0;color:#558c7f}
@media(max-width:900px){
 .home-hero{gap:30px;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}
 .home-title{font-size:39px;letter-spacing:-1.5px}
 .home-lead{font-size:16px}.home-lookup{padding:26px}
 .home-shortcut{padding:17px 8px;gap:13px}
}
@media(max-width:700px){
 .home-page{padding:3px 0 10px}.home-hero{grid-template-columns:1fr;gap:28px}
 .home-intro{padding:0}.home-eyebrow{margin-bottom:15px;font-size:10px}
 .home-title{font-size:clamp(30px,6.5vw,42px);line-height:1.13;letter-spacing:-1.3px;margin-bottom:18px;text-wrap:initial}
 .home-lead{font-size:16px;line-height:1.65;max-width:100%;margin-bottom:15px}
 .home-intro-text{font-size:14px;max-width:100%;margin-bottom:22px}
 .home-create{min-height:44px;font-size:13px;width:fit-content}
 .home-intro>.home-subjects{font-size:11px;margin-top:13px;max-width:100%}
 .home-lookup{padding:24px;border-radius:18px}.home-lookup-title{font-size:23px}
 .home-shortcuts{grid-template-columns:1fr;gap:6px;margin-top:24px;padding-top:15px}
 .home-shortcut{padding:16px 3px}.home-shortcut+.home-shortcut{border-top:1px solid var(--rk-line);border-radius:0}
}
/* QR-inspired lettering; decorative corners leave the ID readable. */
.home-title .nicegui-html{font:inherit;letter-spacing:inherit;line-height:inherit;white-space:pre-line}.home-qr-id{position:relative;display:inline-block;color:#168f84;padding:0 .13em;margin:0 .07em;line-height:1.08;background:linear-gradient(#26a69a,#26a69a) left top/9px 3px no-repeat,linear-gradient(#26a69a,#26a69a) left top/3px 9px no-repeat,linear-gradient(#26a69a,#26a69a) right bottom/9px 3px no-repeat,linear-gradient(#26a69a,#26a69a) right bottom/3px 9px no-repeat}.home-qr-id:after{content:"";position:absolute;right:-3px;top:1px;width:4px;height:4px;background:#26a69a;box-shadow:-6px 0 #26a69a,0 6px #26a69a,-6px 12px #26a69a}

.home-intro>.nicegui-html{width:100%}
.story-stage{display:grid;align-items:start}
.home-story{grid-area:1/1;min-width:0;visibility:hidden;pointer-events:none}
.home-story[aria-hidden="false"]{visibility:visible;pointer-events:auto}
.home-story .home-title{font-size:clamp(30px,3.3vw,40px);line-height:1.14;margin-bottom:22px}
.story-line{position:relative}
.story-reserve{opacity:0}
.story-typed{position:absolute;inset:0;white-space:normal}
.home-story .home-intro-text{margin:0 0 18px;line-height:1.8}
.story-controls{display:flex;align-items:center;gap:8px;margin:12px 0 22px}
.story-controls button{border:1px solid var(--rk-line);background:transparent;color:var(--rk-muted);border-radius:50%;width:36px;height:36px;cursor:pointer;font:500 12px inherit}
.story-select[aria-pressed="true"]{background:var(--rk-deep);border-color:var(--rk-deep);color:white}
.story-controls .story-pause{margin-left:8px}
.story-controls button:focus-visible{outline:3px solid var(--rk-brand);outline-offset:3px}
@media(max-width:640px){.story-controls button{width:44px;height:44px}.home-story .home-title{font-size:30px}}
/* Quiet, manual story navigation and a gentle word reveal. */
.story-controls{gap:10px;margin:12px 0 22px}
.story-count{font-size:11px;letter-spacing:.12em;color:var(--rk-muted);margin-right:8px;font-variant-numeric:tabular-nums}
.story-controls button{height:44px;width:44px;display:inline-flex;align-items:center;justify-content:center;gap:10px;border:1px solid var(--rk-line);font-family:inherit;font-size:12px;font-weight:600;transition:background .18s,border-color .18s}
.story-controls .story-next{width:auto;padding:0 17px;border-radius:24px;color:var(--rk-deep);background:#e6f2ee}
.story-controls button:hover{background:#dcece6;border-color:#accdc2}
.story-controls svg{width:18px;height:18px;fill:none;stroke:currentColor;stroke-width:1.6;stroke-linecap:round;stroke-linejoin:round}
.story-prev svg{transform:rotate(180deg)}
.story-word{display:inline-block;animation:story-word-in .14s ease-out both}
@keyframes story-word-in{from{opacity:0;transform:translateY(2px)}to{opacity:1;transform:translateY(0)}}
@media(prefers-reduced-motion:reduce){.story-word{animation:none}.story-controls button{transition:none}}

/* Actions lead in DOM and on mobile; desktop keeps its two-column composition. */
.home-page{display:grid;grid-template-columns:minmax(0,1.2fr) minmax(0,1fr);column-gap:64px;grid-template-areas:"intro lookup" "purchase lookup" "shortcuts shortcuts";align-items:start}
.home-intro{grid-area:intro}
.home-lookup{grid-area:lookup;align-self:center}
.home-shortcuts{grid-area:shortcuts}
.home-purchase{grid-area:purchase}
.home-purchase .home-subjects{display:block;font-weight:650;color:var(--rk-muted);font-size:11px;line-height:1.7;margin:17px 0 0}
@media(max-width:900px){.home-page{column-gap:30px;grid-template-columns:minmax(0,1.1fr) minmax(0,1fr)}}
@media(max-width:700px){
 .home-page{display:flex;flex-direction:column;gap:0}
 .home-page>section,.home-page>nav{width:100%}
 .home-lookup{padding:20px}
 .home-lookup-heading{margin-bottom:8px}
 .home-lookup-intro{margin-bottom:16px}
 .home-code-input .q-field__control{min-height:58px}
 .home-scan-tip{margin-top:16px;padding-top:14px}
 .home-shortcuts{margin-top:12px;padding-top:0;border-top:0;gap:0}
 .home-shortcut{padding:14px 3px;min-height:76px}
 .home-intro{margin-top:28px;padding-top:24px;border-top:1px solid var(--rk-line)}
 .home-purchase{padding:8px 0 12px}
 .home-purchase .home-create{width:100%;min-height:48px}
 .home-purchase .home-subjects{text-align:center;margin-top:12px}
}

.home-camera-button{color:var(--rk-brand)!important;min-width:44px!important;min-height:44px!important}
.rk-camera-dialog{border:1px solid #d4e2dc;border-radius:20px;padding:24px;width:min(420px,calc(100vw - 32px));max-height:90dvh;overflow:auto;color:#173b34;background:white}
.rk-camera-dialog::backdrop{background:rgba(12,35,30,.6)}
.rk-camera-dialog h2{font-size:22px;line-height:1.3;margin:0 0 16px;font-weight:600}
.rk-camera-dialog video{width:100%;max-height:50dvh;object-fit:cover;border-radius:12px;background:#173b34}
.rk-camera-dialog p{font-size:14px;line-height:1.6;margin:16px 0}
.rk-camera-dialog button{min-height:44px;width:100%;border:1px solid #cddbd5;background:#edf6f3;border-radius:10px;color:#173b34;font:600 14px inherit;cursor:pointer}
.rk-camera-dialog button:focus-visible{outline:3px solid #26a69a;outline-offset:3px}

/* Give lookup and navigation a clear action hierarchy. */
.home-lookup{border-color:#91b8ad;box-shadow:0 4px 18px #143d3909}
.home-shortcuts{gap:12px}
.home-shortcut,.home-shortcut+.home-shortcut{background:#e8f3ef;border:1px solid #a2c4b9;border-radius:14px;padding:18px}
.home-shortcut:hover{background:#dceee6;border-color:#6eaa98}
.home-shortcut-icon{background:#cce5dc;color:#126c5e}
.home-shortcut-arrow{color:#126c5e}
.rek-app .home-camera-button{background:#d8ede5!important;color:#11685e!important;border:1px solid #97bfb1;border-radius:9px!important}
.home-code-input input::placeholder{color:#627d73;opacity:1}
.story-controls button{border-color:#96b5aa;background:white;color:#245c4e}
.story-controls .story-next{border-color:#96b5aa;background:#e6f2ee}
@media(max-width:700px){.home-shortcuts{gap:10px}.home-shortcut{padding:15px;min-height:76px}}

.story-list-link{display:inline-flex;align-items:center;gap:12px;min-height:44px;padding:10px 16px;border-radius:10px;background:#fff2f0;border:1px solid #ecc2bc;color:#b42318!important;font-size:14px;font-weight:650;text-decoration:underline;text-underline-offset:4px;margin:0 0 12px;transition:background .15s,border-color .15s}
.story-list-link:hover{background:#ffe6e2;border-color:#c77569}.story-list-link:focus-visible{outline:3px solid #b42318;outline-offset:3px}.story-list-link span{font-size:14px}.story-list-link .story-warning{width:20px;height:20px;flex-shrink:0}
