:root { color-scheme: light; font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", sans-serif; font-size: 17px; color: #223e35; background: #f5f7f4; }
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
button, input, textarea, select { font: inherit; }
button { min-width: 44px; min-height: 44px; padding: .5rem .8rem; border: 1px solid #9bac9e; border-radius: 12px; background: #fff; color: #244e40; cursor: pointer; }
button:disabled { opacity: .5; cursor: default; }
button:focus-visible, input:focus-visible, textarea:focus-visible, summary:focus-visible { outline: 3px solid #356859; outline-offset: 2px; }
.primary { background: #356859; color: white; border-color: #356859; }
#app { height: 100vh; height: 100dvh; max-width: 42rem; margin: auto; display: flex; flex-direction: column; padding-top: env(safe-area-inset-top); padding-left: env(safe-area-inset-left); padding-right: env(safe-area-inset-right); overflow: hidden; }
header { min-height: 64px; flex-shrink: 0; padding: .5rem 1rem; border-bottom: 1px solid #d7e1d7; display: flex; align-items: center; gap: .5rem; background: #fff; }
h1 { font-size: 1.1rem; margin: 0; letter-spacing: .04em; }
h2 { font-size: 1.3rem; line-height: 1.6; }
#refresh { margin-left: auto; }
#notice { margin: 0; padding: .7rem 1rem; background: #f3e9d6; font-size: .88rem; flex-shrink: 0; }
.login-panel { overflow: auto; padding: 2rem 1.5rem calc(2rem + env(safe-area-inset-bottom)); }
.login-panel p { color: #5b7066; line-height: 1.8; }
#login-form { display: grid; gap: .65rem; margin-top: 2rem; }
#login-form input { width: 100%; min-height: 48px; padding: .7rem; border: 1px solid #9bac9e; border-radius: 10px; background: white; }
#login-button { margin-top: .8rem; }
#main { display: flex; flex-direction: column; flex: 1; min-height: 0; }
#timeline { flex: 1; overflow-y: auto; overscroll-behavior: contain; padding: .8rem .8rem 1.2rem; }
.empty { text-align: center; color: #5b7066; margin: 3rem 0; }
.day { text-align: center; font-size: .76rem; margin: 1.3rem 0 1rem; color: #5b7066; }
.message { margin: .65rem 0; max-width: 88%; width: fit-content; }
.message.self { margin-left: auto; }
.bubble { background: white; border: 1px solid #d7e1d7; border-radius: 16px 16px 16px 4px; padding: .8rem; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.6; text-align: left; }
.self .bubble { background: #e1eee4; border-radius: 16px 16px 4px 16px; }
.question .bubble { background: #f5f7f4; border-style: dashed; }
.message button.bubble { display: block; width: 100%; color: inherit; }
.meta, .hint { font-size: .7rem; color: #52665c; line-height: 1.5; }
.meta { padding: .3rem .25rem 0; }
.self .meta { text-align: right; }
.error { font-size: .82rem; color: #794318; padding: .4rem 0; }
.message .actions { margin-top: .3rem; text-align: right; }
#composer { flex-shrink: 0; background: #fff; border-top: 1px solid #d7e1d7; padding: .55rem .65rem calc(.5rem + env(safe-area-inset-bottom)); }
.modes { border: 0; padding: 0; margin: 0 0 .45rem; display: flex; gap: .4rem; }
.modes label { display: flex; align-items: center; gap: .3rem; padding: .25rem .6rem; min-height: 44px; border-radius: 10px; font-size: .85rem; }
.modes label:has(input:checked) { background: #e1eee4; font-weight: 600; }
input[type=radio], input[type=checkbox] { accent-color: #356859; width: 18px; height: 18px; }
.input-row { display: flex; align-items: flex-end; gap: .4rem; }
#text { min-width: 0; width: 100%; font-size: 17px; line-height: 1.4; max-height: 130px; resize: none; border: 1px solid #9bac9e; border-radius: 12px; padding: .65rem; }
#send { white-space: nowrap; }
#choose-photo { padding: .5rem; }
.hint { margin: .35rem .2rem 0; }
#photo-preview { padding-bottom: .6rem; max-height: 32vh; overflow: auto; }
#preview-image { width: 80px; height: 72px; object-fit: contain; float: left; margin-right: .6rem; }
#photo-preview p { font-size: .75rem; margin: .2rem 0 .4rem; }
#mock-label { font-size: .65rem; background: #f3e9d6; padding: .3rem; border-radius: 6px; }
#mock-controls { flex-shrink: 0; font-size: .7rem; background: #f3e9d6; padding: .3rem .6rem; max-height: 30vh; overflow: auto; }
#mock-controls summary { cursor: pointer; min-height: 30px; }
#mock-controls label { display: block; margin: .5rem 0; }
#mock-controls select { max-width: 100%; }
dialog { border: 1px solid #9bac9e; border-radius: 16px; width: calc(100% - 2rem); max-width: 24rem; color: inherit; padding: 1.2rem; }
dialog::backdrop { background: #20382b66; }
dialog h2 { font-size: 1.05rem; }
dialog form { display: flex; justify-content: flex-end; gap: .7rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
