button, input, textarea, select { font: inherit; }
button, a, input, textarea, select { -webkit-tap-highlight-color: transparent; }
:focus-visible { outline: 3px solid #f8b92d; outline-offset: 4px; }
[hidden] { display: none !important; }
body { font-size: 1rem; line-height: 1.55; }
.portal { position: relative; width: min(100%, 580px); margin: auto; min-height: 100svh; padding: max(22px, env(safe-area-inset-top)) 20px max(24px, env(safe-area-inset-bottom)); }
.portal-header { display: flex; align-items: center; justify-content: space-between; gap: 16px; margin: 12px 0 24px; }
.portal-header h1 { font: 800 clamp(1.7rem, 7vw, 2.5rem)/1.1 Georgia,serif; margin: 0; }
.portal-header a, .portal-header button { flex-shrink: 0; color: white; border: 1px solid #ffffff66; border-radius: 14px; padding: 10px 16px; background: #300646; text-decoration: none; }
.portal-kicker { color: #f3caff; letter-spacing: .12em; font-size: .875rem; font-weight: 800; margin: 0 0 8px; }
.portal-panel { background: #fff5ff; color: #3b0b50; padding: 26px 22px; border: 3px solid #e3bbff; border-radius: 26px; box-shadow: 0 14px 45px #12001f66; }
.portal-panel h2 { font: 800 1.6rem/1.2 Georgia,serif; margin: 0 0 12px; }
.portal-panel .portal-kicker { color: #78288e; }
.portal-panel h3 { font-size: 1.1rem; margin: 26px 0 8px; }
.portal-panel p { margin: 0 0 16px; }
.portal-panel a { color: #68208b; }
.portal-panel label { display: block; font-weight: 750; margin: 18px 0 7px; }
.portal-panel textarea, .portal-panel select { width: 100%; border: 2px solid #ab7ab9; border-radius: 12px; background: white; color: #321040; padding: 12px; font-size: 1rem; }
.portal-panel textarea { min-height: 160px; resize: vertical; }
.portal-panel select { appearance: auto; color-scheme: light; }
.portal-panel small { display: block; font-size: .875rem; color: #684674; }
.portal-panel fieldset { border: 0; padding: 0; margin: 0; min-width: 0; }
.portal-panel legend { font-weight: 750; margin-top: 22px; }
.portal-button { display: inline-flex; align-items: center; justify-content: center; min-height: 50px; gap: 8px; padding: 12px 18px; border: 2px solid #ffffff66; border-radius: 15px; background: #0875c5; color: white; font-weight: 800; text-decoration: none; cursor: pointer; }
.portal-button.secondary { color: #59216f; border-color: #c49cd4; background: white; }
.portal-button:disabled, fieldset:disabled { opacity: .55; cursor: wait; }
.portal-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.portal-actions .portal-button { flex: 1; }
.portal-footer { display: flex; justify-content: center; gap: 24px; flex-wrap: wrap; margin: 28px 0 4px; }
.portal-footer a { color: #fff0ff; font-size: .9rem; text-underline-offset: 4px; }
.welcome-hero { text-align: center; padding: 16px 0 22px; }
.welcome-hero img { display: block; width: min(78%, 300px); height: auto; margin: 0 auto 20px; }
.welcome-hero h1 { font: 800 clamp(2rem, 9vw, 3rem)/1.1 Georgia,serif; margin: 10px 0; }
.welcome-hero p { color: #f6dcff; max-width: 32ch; margin: 14px auto; }
.welcome-features { display: flex; justify-content: space-around; gap: 14px; margin: 0 0 22px; text-align: center; }
.welcome-features strong { display: block; font-size: 1.65rem; line-height: 1.2; color: #b31a9f; }
.welcome-features span { font-size: .875rem; }
.feedback-count { text-align: right; }
.feedback-message { white-space: pre-wrap; overflow-wrap: anywhere; margin-top: 18px; }
.feedback-message.error { color: #a51638; }
.feedback-message.success { padding: 16px; border-radius: 14px; color: #125633; background: #dff6e9; }
.attachment-list { list-style: none; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin: 16px 0; }
.attachment-list li { border: 1px solid #c7a5d3; border-radius: 12px; padding: 10px; overflow: hidden; background: white; }
.attachment-list img, .attachment-list video { width: 100%; height: 120px; object-fit: contain; background: #210334; border-radius: 7px; }
.attachment-list p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: .875rem; margin: 6px 0; }
.attachment-list button { color: #9b173d; background: white; border: 1px solid #c89baa; border-radius: 8px; padding: 7px 12px; min-height: 40px; }
#record-preview { width: 100%; border-radius: 14px; margin-top: 12px; background: #1c0525; }
#upload-progress { width: 100%; margin-top: 16px; }
.guide-v3 { overflow: auto; }
.guide-screen-v3 { height: auto; min-height: 100svh; grid-template-rows: auto 1fr auto; }
.guide-v3 .rule-list p, .guide-v3 .rule-list strong, .guide-v3 .lesson-lead, .guide-v3 .magic-tip span { font-size: 1rem; line-height: 1.45; }
.guide-v3 .spellbook { overflow: visible; }
.guide-actions-v3 { position: sticky; bottom: env(safe-area-inset-bottom); padding: 8px 0; background: #2a064b; border-radius: 16px; }
.policy-content section + section { margin-top: 24px; }
.policy-content a { overflow-wrap: anywhere; }
@media (max-width: 360px) { .portal { padding-left: 12px; padding-right: 12px; } .portal-panel { padding: 20px 16px; } .attachment-list { grid-template-columns: 1fr; } }
