:root {
  font-family: Inter, "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: #17241f;
  background: #eef2f0;
  font-synthesis: none;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { width: 100%; height: 100%; margin: 0; overflow: hidden; }
button, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.login-view { display: grid; min-height: 100%; place-items: center; padding: 24px; background: #eef2f0; }
.login-card { width: min(100%, 390px); padding: 30px 24px; border: 1px solid #d6dedb; border-radius: 20px; background: #fff; box-shadow: 0 14px 42px rgb(28 48 40 / 12%); }
.login-card h1 { margin: 0; font-size: 30px; letter-spacing: -.04em; }
.login-card p { margin: 8px 0 28px; color: #617069; font-size: 14px; }
.login-card label { display: grid; gap: 7px; margin-top: 16px; color: #394942; font-size: 13px; font-weight: 700; }
.login-card input { width: 100%; min-height: 50px; padding: 0 14px; border: 1px solid #cbd6d1; border-radius: 11px; background: #fbfcfb; outline: none; font-size: 16px; }
.login-card input:focus { border-color: #1e8154; box-shadow: 0 0 0 3px rgb(30 129 84 / 14%); }
.login-card button { width: 100%; min-height: 52px; margin-top: 24px; border: 0; border-radius: 11px; color: #fff; background: #18794d; font-weight: 800; }
.form-error { display: block; min-height: 20px; margin-top: 10px; color: #b22f2b; font-size: 12px; text-align: center; }

.app, #map { position: absolute; inset: 0; }
.topbar { position: fixed; z-index: 4; top: max(10px, env(safe-area-inset-top)); right: 10px; left: 10px; min-height: 58px; padding: 8px 10px 8px 14px; display: flex; align-items: center; justify-content: space-between; gap: 8px; border: 1px solid rgb(37 61 51 / 14%); border-radius: 14px; background: rgb(255 255 255 / 94%); box-shadow: 0 4px 18px rgb(22 43 34 / 13%); backdrop-filter: blur(10px); }
.topbar h1 { margin: 0; font-size: 19px; letter-spacing: -.03em; }
.session-info { display: flex; align-items: center; gap: 8px; color: #3e4e47; font-size: 12px; }
.sync-state { color: #18794d; font-weight: 750; }
.sync-state.error { color: #b22f2b; }
.icon-button, .close-button { border: 0; color: #273932; background: transparent; cursor: pointer; }
.icon-button { width: 38px; height: 38px; font-size: 24px; }

.legend { position: fixed; z-index: 3; top: calc(max(10px, env(safe-area-inset-top)) + 68px); right: 10px; display: grid; grid-template-columns: auto auto; gap: 5px 10px; padding: 9px 10px; border: 1px solid rgb(37 61 51 / 13%); border-radius: 11px; background: rgb(255 255 255 / 92%); box-shadow: 0 3px 12px rgb(22 43 34 / 10%); font-size: 11px; }
.legend span { display: flex; align-items: center; gap: 5px; }
.legend i { width: 11px; height: 11px; border: 1px solid rgb(30 47 40 / 25%); border-radius: 3px; }
.legend .done { background: #26925e; }.legend .rejected { background: #d14942; }.legend .later { background: #f0c640; }.legend .pending { background: #f1dfd6; }

.locate { position: fixed; z-index: 3; right: 12px; bottom: 198px; width: 52px; height: 52px; border: 1px solid rgb(37 61 51 / 13%); border-radius: 50%; background: #fff; box-shadow: 0 4px 16px rgb(22 43 34 / 16%); }
.locate span, .locate span::before, .locate span::after { position: absolute; display: block; content: ""; }
.locate span { inset: 14px; border: 3px solid #1f6fd5; border-radius: 50%; }
.locate span::before { inset: 5px; border-radius: 50%; background: #1f6fd5; }
.locate span::after { top: -8px; left: 8px; width: 3px; height: 29px; background: #1f6fd5; box-shadow: 0 0 0 4px #fff; transform: rotate(90deg); z-index: -1; }

.sheet { position: fixed; z-index: 5; right: 8px; bottom: max(8px, env(safe-area-inset-bottom)); left: 8px; padding: 8px 12px 13px; border: 1px solid rgb(37 61 51 / 10%); border-radius: 18px; background: rgb(255 255 255 / 97%); box-shadow: 0 -4px 26px rgb(22 43 34 / 17%); transform: translateY(calc(100% + 20px)); transition: transform 180ms ease-out; }
.sheet.open { transform: translateY(0); }
.handle { width: 35px; height: 4px; margin: 0 auto 9px; border-radius: 3px; background: #c6d0cc; }
.sheet-heading { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.sheet-heading strong, .sheet-heading span { display: block; }
.sheet-heading strong { font-size: 17px; }.sheet-heading span { margin-top: 2px; color: #5d6d66; font-size: 12px; }
.close-button { width: 40px; height: 40px; font-size: 26px; }
.statuses { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.statuses button { min-height: 50px; border: 0; border-radius: 11px; color: #fff; font-size: 15px; font-weight: 850; }
.statuses [data-status="done"] { background: #218653; }.statuses [data-status="rejected"] { background: #cc423b; }.statuses [data-status="later"] { color: #493900; background: #efc33a; }
.statuses [data-status="pending"] { grid-column: 1 / -1; min-height: 42px; color: #34443d; background: #e2e7e5; font-size: 13px; }
.sheet small { display: block; margin-top: 10px; color: #607068; font-size: 11px; }
.toast { position: fixed; z-index: 8; top: calc(max(10px, env(safe-area-inset-top)) + 70px); left: 50%; max-width: calc(100% - 32px); padding: 9px 13px; border-radius: 9px; color: #fff; background: #20342c; box-shadow: 0 4px 14px rgb(20 35 29 / 22%); font-size: 12px; opacity: 0; pointer-events: none; transform: translate(-50%, -8px); transition: 150ms ease; }
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.maplibregl-ctrl-bottom-right { bottom: 10px; }.sheet.open ~ .maplibregl-ctrl-bottom-right { bottom: 185px; }
.maplibregl-ctrl-attrib { font-size: 9px; }

@media (min-width: 720px) {
  .topbar { right: auto; width: 460px; }
  .legend { right: 14px; top: 14px; }
  .sheet { right: 14px; bottom: 14px; left: auto; width: 430px; }
  .locate { right: 24px; bottom: 230px; }
}

@media (prefers-reduced-motion: reduce) { .sheet, .toast { transition: none; } }
