/* Compose: one calm writing surface. Type switch, one card, one action. */
.crab-h5 .crab-compose { position: relative; isolation: isolate; background: var(--sand); }
.crab-h5 .compose-topbar { display: grid; grid-template-columns: 44px minmax(0,1fr) auto; align-items: center; flex: none; min-height: calc(62px + var(--h5-safe-top)); gap: 10px; padding: calc(10px + var(--h5-safe-top)) 20px 4px; }
.crab-h5 .compose-topbar > span { min-width: 0; color: var(--ink); font-size: 16px; font-weight: 800; text-align: center; overflow-wrap: anywhere; }
.crab-h5 .compose-close { display: grid; place-items: center; width: 44px; min-height: 44px; border: var(--comic-line); border-radius: 50%; background: var(--surface); box-shadow: 2px 2px 0 var(--ink); }
.crab-h5 .compose-close svg { width: 22px; height: 22px; transform: rotate(45deg); }
.crab-h5 .compose-save { min-height: 44px; padding: 0 4px; font-size: 13px; font-weight: 800; white-space: nowrap; }
.crab-h5 .compose-scroll { display: flex; flex-direction: column; padding: 10px 20px 14px; scroll-padding: 18px; }
.crab-h5 .compose-types { display: grid; grid-template-columns: repeat(4,minmax(0,1fr)); flex: none; gap: 8px; margin: 0 0 40px; padding: 0; border: 0; border-radius: 0; background: transparent; }
.crab-h5 .compose-types button { display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 4px; min-height: 84px; min-width: 0; padding: 8px 4px 9px; border: 1.5px solid #201c2240; border-radius: 22px; background: var(--surface); color: var(--ink-2); font-size: 14px; font-weight: 800; }
.crab-h5 .compose-types button.is-active { border-color: var(--ink); background: var(--yellow); color: var(--ink); box-shadow: 2px 3px 0 var(--ink); }
.crab-h5 .compose-type-art { display: block; width: 44px; height: 44px; flex: none; }
.crab-h5 .compose-type-art svg { display: block; width: 100%; height: 100%; overflow: visible; }
.crab-h5 .compose-writing { position: relative; display: flex; flex-direction: column; flex: 1 0 auto; min-height: min-content; padding: 16px 16px 12px; border: var(--comic-line); border-radius: 20px; background: var(--surface); box-shadow: 3px 4px 0 var(--ink); }
.crab-h5 .compose-scroll.is-help .compose-writing { flex: none; }
.crab-h5 .compose-scroll.is-help .compose-writing #draft-body { flex: none; min-height: 88px; }
.crab-h5 .compose-writing:focus-within { border-color: #427eb9; box-shadow: 3px 4px 0 #79b8f68c; }
.crab-h5 .compose-writing-crab { position: absolute; z-index: 1; width: 62px; right: 14px; top: -36px; transform: rotate(-4deg); pointer-events: none; }
.crab-h5 .compose-writing-crab svg { display: block; width: 100%; height: auto; }
.crab-h5 .compose-title-line { display: flex; align-items: center; gap: 8px; padding-bottom: 8px; border-bottom: 1px solid #201c2226; }
.crab-h5 .compose-title-line > span { flex: none; color: var(--ink-2); font: 500 10px/1.5 var(--mono); }
.crab-h5 .compose-writing #draft-title { display: block; flex: 1; min-width: 0; height: 44px; padding: 0; border: 0; border-radius: 0; background: transparent; font: 800 20px/1.4 var(--sans); outline: 0; }
.crab-h5 .compose-writing #draft-title::placeholder, .crab-h5 .compose-writing #draft-body::placeholder { color: #77707d; opacity: 1; }
.crab-h5 .compose-writing #draft-body { display: block; width: 100%; flex: 1 0 auto; min-height: 120px; resize: none; margin-top: 10px; padding: 0; border: 0; border-radius: 0; background: transparent; color: var(--ink); font: 400 16px/1.75 var(--sans); outline: 0; }
.crab-h5 .compose-photo-bar { margin-top: 6px; }
.crab-h5 .compose-location { display: flex; align-items: center; flex-wrap: wrap; flex: none; gap: 8px; margin-top: 8px; padding-top: 12px; border-top: 1px solid #201c2226; }
.crab-h5 .compose-photo-tool { position: relative; display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 6px; border: var(--comic-line); border-radius: 22px; background: var(--blue-soft, #e0efff); color: var(--ink); }
.crab-h5 .compose-photo-tool.is-full { background: var(--sand); }
.crab-h5 .compose-tool-art { position: relative; display: block; width: 32px; height: 28px; flex: none; }
.crab-h5 .compose-tool-art svg { display: block; width: 100%; height: 100%; }
.crab-h5 .compose-tool-art i { position: absolute; right: -5px; bottom: -4px; display: grid; place-items: center; width: 16px; height: 16px; border: 1.4px solid var(--ink); border-radius: 50%; background: var(--coral); font: 800 13px/1 var(--sans); font-style: normal; }
.crab-h5 .compose-photo-tool b { font: 700 12px/1 var(--mono); }
.crab-h5 .compose-photo-tool small { color: var(--ink-2); font-size: 10px; }
.crab-h5 .compose-city,
.crab-h5 .compose-add-place,
.crab-h5 .compose-place-chip > button { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px 0 9px; border: var(--comic-line); border-radius: 22px; background: var(--surface); font-size: 13px; font-weight: 700; line-height: 1.3; }
.crab-h5 .compose-loc-mark { display: grid; place-items: center; width: 16px; height: 16px; flex: none; }
.crab-h5 .compose-loc-mark .post-icon { display: block; width: 16px; height: 16px; }
.crab-h5 .compose-city { flex: 0 1 auto; max-width: 100%; }
.crab-h5 .compose-city > span, .crab-h5 .compose-add-place > span { min-width: 0; overflow-wrap: anywhere; }
.crab-h5 .compose-city i { flex: none; color: var(--ink-2); font-style: normal; }
.crab-h5 .compose-add-place { flex: 0 1 auto; max-width: 100%; background: var(--yellow); }
.crab-h5 .compose-add-place:disabled { opacity: .7; }
.crab-h5 .compose-place-chip { display: grid; grid-template-columns: minmax(0,max-content) 44px; align-items: center; flex: 1 1 auto; max-width: 100%; min-width: 0; min-height: 48px; padding: 2px 2px 2px 8px; border: var(--comic-line); border-radius: 24px; background: var(--surface); }
.crab-h5 .compose-place-chip .compose-loc-mark { width: 26px; height: 26px; border: 1.4px solid var(--ink); border-radius: 50%; background: var(--yellow); }
.crab-h5 .compose-place-chip .compose-loc-mark .post-icon { width: 14px; height: 14px; }
.crab-h5 .compose-location .compose-place-chip > button:first-child { min-width: 0; min-height: 40px; justify-content: flex-start; gap: 8px; padding: 4px 6px 4px 0; border: 0; border-radius: 0; background: transparent; text-align: left; }
.crab-h5 .compose-place-chip b { min-width: 0; font: 700 13px/1.4 var(--sans); overflow-wrap: anywhere; }
.crab-h5 .compose-location .compose-place-chip > .compose-clear-place { display: grid; place-items: center; width: 44px; min-width: 44px; height: 44px; min-height: 44px; padding: 0; border: 0; border-radius: 50%; background: transparent; color: var(--ink-2); font-size: 20px; font-weight: 700; line-height: 1; }
.crab-h5 .compose-place-block { flex: none; margin-top: 10px; }
.crab-h5 .compose-place-field { display: block; margin: 0 0 6px; color: var(--ink); font-size: 12px; font-weight: 800; }
.crab-h5 #draft-place { display: block; width: 100%; min-height: 46px; padding: 0 14px; border: 1.5px solid #201c2240; border-radius: 14px; background: var(--sand); font: 400 16px/1.4 var(--sans); }
.crab-h5 #draft-place:focus { border-color: var(--ink); outline: 0; }
.crab-h5 .compose-place-block .compose-location-note { margin-top: 6px; }
.crab-h5 .compose-location-note, .crab-h5 .compose-local-note { margin: 8px 0 0; color: var(--ink-2); font-size: 11px; line-height: 1.5; }
.crab-h5 .compose-local-note { flex: none; margin-top: 12px; text-align: center; }
.crab-h5 .compose-help-fields { position: relative; flex: none; margin-top: 16px; padding: 14px 16px 18px; border: var(--comic-line); border-radius: 20px; background: var(--surface); }
.crab-h5 .compose-help-fields h2 { margin: 0 0 4px; font-size: 16px; }
.crab-h5 .compose-help-fields .form-label { margin-top: 12px; font-size: 12px; }
.crab-h5 .compose-help-fields .mobile-input { min-height: 46px; background: var(--sand); }
.crab-h5 .compose-footer { position: relative; z-index: 5; flex: none; padding: 10px 20px max(10px,env(safe-area-inset-bottom)); background: var(--sand); }
.crab-h5 .compose-submit { display: flex; justify-content: space-between; align-items: center; width: 100%; min-height: 52px; padding: 0 22px; border: var(--comic-line); border-radius: 27px; background: var(--coral); color: var(--ink); font-size: 16px; font-weight: 900; box-shadow: 3px 3px 0 var(--ink); }
.crab-h5 .compose-submit > span:last-child { font-size: 24px; font-weight: 500; }
.crab-h5 .compose-footer p { margin-top: 7px; text-align: center; color: var(--ink-2); font-size: 11px; line-height: 1.4; }
.crab-h5 .crab-compose button:active { translate: 0 1px; }
.crab-h5 .crab-compose button:focus-visible { outline: 3px solid #427eb9; outline-offset: 3px; }
@media(max-width:360px) {
  .crab-h5 .compose-scroll { padding-inline: 15px; }
  .crab-h5 .compose-topbar, .crab-h5 .compose-footer { padding-inline: 15px; }
  .crab-h5 .compose-types button { gap: 4px; font-size: 13px; }
  .crab-h5 .compose-type-art { width: 38px; height: 38px; }
  .crab-h5 .compose-types { gap: 6px; }
  .crab-h5 .compose-types button { min-height: 76px; font-size: 13px; }
  .crab-h5 .compose-writing { padding-inline: 13px; }
  .crab-h5 .compose-writing-crab { width: 54px; right: 10px; top: -31px; }
}
@media(max-height:720px) {
  .crab-h5 .compose-types { margin-bottom: 28px; }
  .crab-h5 .compose-types button { min-height: 72px; }
  .crab-h5 .compose-writing { flex: none; }
  .crab-h5 .compose-writing #draft-body { min-height: 64px; }
  .crab-h5 .compose-scroll { padding-bottom: 8px; }
}
@media(prefers-reduced-motion:reduce) {
  .crab-h5 .crab-compose *, .crab-h5 .crab-compose *::before, .crab-h5 .crab-compose *::after { animation: none !important; transition: none !important; }
}
.crab-h5 .compose-photo-order { margin: 7px 0 0; color: var(--ink); font-size: 11px; font-weight: 700; line-height: 1.4; overflow-wrap: anywhere; }
.crab-h5 .compose-photo-strip { display: flex; gap: 10px; overflow-x: auto; padding: 11px 0 2px; scroll-snap-type: x proximity; scrollbar-width: thin; }
.crab-h5 .compose-photo-strip.is-reordering { scroll-snap-type: none; touch-action: none; }
.crab-h5 .compose-photo-frame { position: relative; flex: 0 0 98px; height: 115px; padding: 4px 4px 14px; border: 1.5px solid var(--ink); border-radius: 3px; background: var(--surface); scroll-snap-align: start; }
.crab-h5 .compose-photo-frame.can-reorder { flex-basis: 112px; height: auto; padding: 4px 0 0; cursor: grab; }
.crab-h5 .compose-photo-frame img { width: 100%; height: 100%; object-fit: cover; border-radius: 1px; -webkit-user-drag: none; user-select: none; -webkit-touch-callout: none; }
.crab-h5 .compose-photo-frame.can-reorder img { width: calc(100% - 8px); height: 100px; margin: 0 4px; flex: none; }
.crab-h5 .compose-photo-chin { height: 18px; text-align: center; }
.crab-h5 .compose-photo-chin .compose-cover-label { position: static; display: block; padding: 3px 6px 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.crab-h5 .compose-photo-tools { position: absolute; left: 0; right: 0; bottom: 18px; display: flex; justify-content: space-between; align-items: center; min-height: 44px; }
.crab-h5 .compose-shift,
.crab-h5 .compose-shift-slot { display: grid; place-items: center; width: 44px; height: 44px; flex: none; }
.crab-h5 .compose-shift { color: white; text-shadow: 0 1px 2px #201c22; font: 700 22px/1 var(--sans); background: radial-gradient(circle at center,#201c22cc 0 14px,transparent 15px); }
.crab-h5 .compose-shift:active { background: radial-gradient(circle at center,#201c22 0 14px,transparent 15px); }
.crab-h5 .compose-photo-frame.can-reorder button { cursor: pointer; }
.crab-h5 .compose-photo-frame.is-photo-source { opacity: .35; }
.crab-h5 .compose-photo-ghost { position: fixed; z-index: 30; margin: 0; pointer-events: none; box-shadow: 4px 5px 0 var(--ink); }
.crab-h5 .compose-remove-photo { position: absolute; display: grid; place-items: center; top: 0; right: 0; width: 44px; height: 44px; color: white; text-shadow: 0 1px 2px #201c22; font: 700 25px/1 var(--sans); background: radial-gradient(circle at center,#201c22aa 0 12px,transparent 13px); }
.crab-h5 .compose-cover-label { position: absolute; bottom: 4px; left: 0; right: 0; text-align: center; font: 600 8px/1 var(--mono); }

.crab-h5 .compose-types button:disabled { opacity: .45; }
.crab-h5 .compose-event-fields { display: flex; flex: none; flex-direction: column; gap: 8px; margin-top: 24px; padding: 18px 16px; border: 1px solid #201c2238; border-radius: 20px; background: #fff9ef; }
.crab-h5 .compose-event-fields label { margin-top: 6px; font-size: 15px; font-weight: 700; }
.crab-h5 .compose-event-fields input, .crab-h5 .compose-event-fields select { box-sizing: border-box; width: 100%; min-width: 0; max-width: 100%; min-height: 48px; padding: 10px; border: 1px solid #201c2250; border-radius: 10px; background: var(--surface); color: var(--ink); font: 400 16px/1.5 var(--sans); }
.crab-h5 .compose-event-fields input:focus-visible, .crab-h5 .compose-event-fields select:focus-visible { outline: 3px solid var(--blue); outline-offset: 2px; }
.crab-h5 .compose-event-fields p { margin: 0; color: var(--ink-2); font-size: 13px; line-height: 1.6; }
.crab-h5 .own-event { min-width: 0; break-inside: avoid; margin: 0 0 14px; padding: 14px; border: 1px solid #201c2238; border-radius: 14px; background: #fff9ef; overflow-wrap: anywhere; }
.crab-h5 .own-event h3 { margin: 8px 0; font-size: 17px; line-height: 1.5; }
.crab-h5 .own-event p { margin: 6px 0; font-size: 14px; line-height: 1.6; }
.crab-h5 .own-event .collection-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.crab-h5 .own-event .text-button { min-height: 44px; }
.crab-h5 .own-event-reason { color: #8a3023; }

.crab-h5 .publication-grid { display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); gap: 12px; align-items: start; }
.crab-h5 .publication-item { min-width: 0; }
.crab-h5 .publication-item.is-activity { grid-column: 1 / -1; }
.crab-h5 .publication-item .own-event { margin: 0; }
