:root {
  --ink: #17342e;
  --muted: #68746e;
  --cream: #f4efe6;
  --paper: #fffdf8;
  --line: #ded8cc;
  --coral: #ed684c;
  --coral-dark: #cf4f37;
  --sage: #9eb4a8;
  --green: #2d6b58;
  --shadow: 0 18px 50px rgba(31, 53, 46, .11);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--cream);
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--cream); }
body { min-height: 100vh; margin: 0; background: var(--cream); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
[hidden] { display: none !important; }

.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); font-family: Georgia, serif; font-size: 22px; font-weight: 700; text-decoration: none; letter-spacing: -.4px; }
.brand--light { color: white; }
.brand-mark { position: relative; display: inline-grid; place-items: center; width: 30px; height: 30px; border: 2px solid currentColor; border-radius: 50% 50% 50% 10%; transform: rotate(-45deg); }
.brand-mark span { width: 8px; height: 8px; border: 2px solid currentColor; border-radius: 50%; }
.brand-mark span, .brand > span:last-child { transform: rotate(0); }
.brand-mark span { transform: rotate(45deg); }

.eyebrow { margin: 0 0 9px; color: var(--coral-dark); font-size: 11px; font-weight: 800; letter-spacing: 1.8px; text-transform: uppercase; }
.eyebrow--light { color: #ffd1c4; }

.auth-shell { min-height: 100vh; display: grid; grid-template-columns: minmax(420px, 1.1fr) minmax(420px, .9fr); }
.auth-intro { position: relative; overflow: hidden; display: flex; flex-direction: column; justify-content: space-between; min-height: 100vh; padding: 52px clamp(44px, 7vw, 110px) 70px; color: white; background: var(--ink); }
.auth-intro::before, .auth-intro::after { content: ""; position: absolute; border: 1px solid rgba(255,255,255,.11); border-radius: 50%; pointer-events: none; }
.auth-intro::before { width: 620px; height: 620px; right: -340px; top: -180px; }
.auth-intro::after { width: 380px; height: 380px; right: -215px; top: -60px; }
.auth-copy { position: relative; z-index: 1; max-width: 620px; margin: auto 0; padding: 80px 0; }
.auth-copy h1 { max-width: 650px; margin: 0 0 25px; font-family: Georgia, serif; font-size: clamp(48px, 5.2vw, 78px); font-weight: 500; letter-spacing: -3px; line-height: .99; }
.auth-copy > p:last-child { max-width: 520px; margin: 0; color: #c3d1cb; font-size: 18px; line-height: 1.7; }
.auth-proof { position: relative; display: flex; align-items: center; gap: 18px; width: fit-content; min-width: 290px; padding: 18px 20px; border: 1px solid rgba(255,255,255,.13); border-radius: 16px; background: rgba(255,255,255,.07); backdrop-filter: blur(7px); }
.proof-pin { width: 32px; height: 32px; border: 2px solid #ffb8a8; border-radius: 50% 50% 50% 10%; transform: rotate(-45deg); }
.auth-proof div { display: grid; gap: 2px; }
.auth-proof strong { font-size: 17px; }
.auth-proof small { color: #b8c9c2; }
.proof-check { margin-left: auto; display: grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; color: var(--ink); background: #b9d2c7; font-weight: 900; }
.auth-panel { display: grid; place-items: center; min-height: 100vh; padding: 42px; background: var(--paper); }
.auth-card { width: min(100%, 430px); }
.mobile-brand { display: none; }
.auth-card h2 { margin: 0 0 9px; font-family: Georgia, serif; font-size: 38px; font-weight: 500; letter-spacing: -1.2px; }
.form-lede { margin: 0 0 32px; color: var(--muted); line-height: 1.55; }
.auth-tabs { display: grid; grid-template-columns: 1fr 1fr; margin-bottom: 25px; border-bottom: 1px solid var(--line); }
.auth-tab { position: relative; border: 0; padding: 12px 8px; color: #7b837f; background: transparent; cursor: pointer; font-weight: 700; }
.auth-tab::after { content: ""; position: absolute; height: 2px; right: 0; bottom: -1px; left: 0; background: transparent; }
.auth-tab.is-active { color: var(--ink); }
.auth-tab.is-active::after { background: var(--coral); }
.auth-form { display: grid; gap: 18px; }
.auth-form label { display: grid; gap: 8px; font-size: 13px; font-weight: 750; }
.auth-form input { width: 100%; min-height: 50px; border: 1px solid var(--line); border-radius: 10px; padding: 0 15px; outline: none; color: var(--ink); background: white; transition: border .2s, box-shadow .2s; }
.auth-form input:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,107,88,.12); }
.primary-button, .google-button { display: flex; align-items: center; justify-content: center; min-height: 51px; border-radius: 10px; font-weight: 800; text-decoration: none; cursor: pointer; }
.primary-button { margin-top: 4px; border: 0; color: white; background: var(--ink); box-shadow: 0 9px 25px rgba(23,52,46,.16); }
.primary-button:hover { background: #23473f; }
.primary-button:disabled { cursor: wait; opacity: .65; }
.form-error { margin: 15px 0 0; border-radius: 8px; padding: 11px 13px; color: #9b3527; background: #fff0ec; font-size: 13px; }
.registration-notice { margin: 18px 0 0; border-radius: 9px; padding: 12px 14px; color: #5e665f; background: #f0ece4; font-size: 12px; line-height: 1.5; }
.auth-tabs.is-single { grid-template-columns: 1fr; }
.or-divider { display: flex; align-items: center; gap: 12px; margin: 24px 0 18px; color: #999; font-size: 12px; }
.or-divider::before, .or-divider::after { content: ""; height: 1px; flex: 1; background: var(--line); }
.google-button { gap: 12px; border: 1px solid var(--line); color: var(--ink); background: white; }
.google-button span { font-family: Arial, sans-serif; color: #4285f4; font-size: 18px; font-weight: 900; }

.app-shell { min-height: 100vh; background: var(--cream); }
.app-header { position: relative; z-index: 10; display: flex; align-items: center; justify-content: space-between; height: 82px; max-width: 1180px; margin: 0 auto; padding: 0 30px; border-bottom: 1px solid rgba(23,52,46,.12); }
.header-actions { position: relative; display: flex; align-items: center; gap: 18px; }
.today-label { color: var(--muted); font-size: 12px; font-weight: 750; letter-spacing: .7px; text-transform: uppercase; }
.icon-button { display: grid; align-content: center; gap: 4px; width: 42px; height: 42px; border: 1px solid var(--line); border-radius: 50%; padding: 0 13px; background: rgba(255,255,255,.55); cursor: pointer; }
.icon-button span { height: 2px; border-radius: 5px; background: var(--ink); }
.account-menu { position: absolute; top: 52px; right: 0; width: 260px; padding: 9px; border: 1px solid var(--line); border-radius: 16px; background: var(--paper); box-shadow: var(--shadow); }
.menu-person { display: flex; align-items: center; gap: 11px; padding: 10px 9px 14px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.avatar { display: grid; place-items: center; width: 36px; height: 36px; flex: 0 0 auto; border-radius: 50%; color: white; background: var(--green); font-weight: 800; }
.menu-person div { min-width: 0; display: grid; gap: 2px; }
.menu-person strong, .menu-person small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-person small { color: var(--muted); }
.account-menu > button { display: flex; gap: 11px; width: 100%; border: 0; border-radius: 9px; padding: 11px; background: transparent; cursor: pointer; text-align: left; }
.account-menu > button:hover { background: #f1ece3; }

.capture-zone { position: relative; overflow: hidden; display: grid; justify-items: center; min-height: 720px; padding: 67px 24px 62px; text-align: center; }
.capture-zone::before { content: ""; position: absolute; z-index: 0; width: 660px; height: 660px; top: 65px; border: 1px solid rgba(45,107,88,.08); border-radius: 50%; }
.capture-copy { position: relative; z-index: 1; }
.capture-copy h1 { margin: 0 0 10px; font-family: Georgia, serif; font-size: clamp(42px, 5vw, 64px); font-weight: 500; letter-spacing: -2.3px; line-height: 1; }
.capture-copy > p:last-child { margin: 0; color: var(--muted); font-size: 15px; }
.log-wrap { position: relative; z-index: 2; display: grid; place-items: center; width: 255px; height: 255px; margin: 27px 0 20px; }
.orbit { position: absolute; border: 1px solid rgba(237,104,76,.20); border-radius: 50%; }
.orbit--one { width: 238px; height: 238px; }
.orbit--two { width: 210px; height: 210px; }
.log-button { position: relative; display: grid; place-items: center; width: 176px; height: 176px; border: 0; border-radius: 50%; padding: 0; color: white; background: var(--coral); box-shadow: 0 20px 38px rgba(205,74,47,.28), inset 0 -8px 0 rgba(142,48,30,.13); cursor: pointer; transition: transform .2s ease, box-shadow .2s ease; }
.log-button::before { content: ""; position: absolute; inset: -7px; border: 1px solid rgba(237,104,76,.46); border-radius: inherit; }
.log-button:hover { transform: translateY(-3px) scale(1.02); box-shadow: 0 25px 44px rgba(205,74,47,.34), inset 0 -8px 0 rgba(142,48,30,.13); }
.log-button:active { transform: translateY(1px) scale(.98); }
.log-button:focus-visible { outline: 4px solid rgba(45,107,88,.35); outline-offset: 7px; }
.manual-entry-button { position: relative; z-index: 2; border: 0; padding: 8px 16px; color: #68736d; background: transparent; font-size: 13px; cursor: pointer; }
.manual-entry-button:hover { color: var(--green); text-decoration: underline; }
.manual-entry-button:focus-visible { outline: 2px solid var(--green); outline-offset: 3px; border-radius: 6px; }
#manual-event-time-field { display: grid; gap: 6px; font-size: 12px; }
#manual-event-time { width: 100%; min-width: 0; min-height: 44px; padding: 8px; border: 1px solid var(--line); border-radius: 8px; background: white; color: var(--ink); font-size: 16px; }
.capture-location-actions { display: flex; flex-wrap: wrap; gap: 4px 16px; align-items: center; }
#capture-location-map { height: 300px; width: 100%; border: 1px solid var(--line); border-radius: 12px; }
#capture-map-picker > p { margin: 0 0 10px; color: var(--muted); font-size: 13px; }
#capture-map-picker button:disabled { opacity: .45; cursor: default; }
.capture-location-pin { background: transparent; }
.capture-location-pin > span { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid white; border-radius: 50% 50% 50% 4px; background: var(--coral); color: white; transform: rotate(-45deg); box-shadow: 0 3px 7px rgba(15,31,26,.3); }
.capture-location-pin b { transform: rotate(45deg); }
.capture-address-search { display: grid; gap: 6px; margin-bottom: 8px; }
.capture-address-search > div { display: flex; gap: 10px; }
#capture-address-query { flex: 1; width: 100%; min-width: 0; min-height: 44px; font-size: 16px; border: 1px solid var(--line); border-radius: 8px; padding: 8px; }
#capture-address-results { display: grid; gap: 6px; margin-bottom: 10px; }
.capture-address-result { text-align: left; border: 1px solid var(--line); border-radius: 8px; background: white; padding: 10px; font-size: 13px; overflow-wrap: anywhere; cursor: pointer; }
#capture-map-picker .geocoding-notice { font-size: 11px; }
.capture-address-heading { align-items: center; }
.capture-address-help { border: 0; padding: 4px; color: var(--muted); background: transparent; font-size: 12px; cursor: pointer; }
.capture-address-help:hover { color: var(--green); }
#capture-map-picker .geocoding-notice { padding: 10px; border: 1px solid var(--line); border-radius: 8px; background: white; }
.log-button__inner { display: grid; justify-items: center; }
.log-button strong { margin-top: 8px; font-size: 27px; letter-spacing: 3.5px; }
.log-button small { margin-top: 1px; font-size: 9px; font-weight: 800; letter-spacing: 2.5px; opacity: .82; }
.log-icon { position: relative; width: 24px; height: 24px; border: 2px solid white; border-radius: 50% 50% 50% 10%; transform: rotate(-45deg); }
.log-icon i { position: absolute; inset: 7px; border-radius: 50%; background: white; }
.log-button.is-loading { animation: pulse 1.25s ease-in-out infinite; cursor: wait; }
.log-button.is-loading .log-icon { animation: spin 1s linear infinite; }
.log-button.is-success { background: var(--green); box-shadow: 0 20px 38px rgba(45,107,88,.28); }
.log-button.is-success .log-icon { border-radius: 50%; transform: none; }
.log-button.is-success .log-icon::after { content: "✓"; position: absolute; inset: -4px; font-size: 22px; }
.log-button.is-success .log-icon i { display: none; }
@keyframes pulse { 50% { box-shadow: 0 20px 38px rgba(205,74,47,.20), 0 0 0 16px rgba(237,104,76,.08); } }
@keyframes spin { to { transform: rotate(315deg); } }

.capture-options { position: relative; z-index: 3; display: grid; justify-items: center; gap: 12px; min-height: 62px; }
.photo-button { display: flex; align-items: center; gap: 13px; min-width: 220px; border: 1px solid var(--line); border-radius: 13px; padding: 10px 13px; background: rgba(255,255,255,.6); cursor: pointer; text-align: left; }
.photo-button:hover { border-color: var(--sage); background: white; }
.photo-button:disabled { cursor: default; opacity: .68; }
.photo-button > span:nth-child(2) { display: grid; gap: 2px; flex: 1; }
.photo-button strong { font-size: 13px; }
.photo-button small { color: var(--muted); font-size: 11px; }
.plus-icon { font-size: 22px; font-weight: 300; color: var(--muted); }
.camera-icon { position: relative; width: 28px; height: 22px; border: 1.5px solid var(--ink); border-radius: 5px; }
.camera-icon::before { content: ""; position: absolute; width: 9px; height: 4px; top: -5px; left: 8px; border: 1.5px solid var(--ink); border-bottom: 0; border-radius: 3px 3px 0 0; }
.camera-icon::after { content: ""; position: absolute; width: 7px; height: 7px; top: 5px; left: 9px; border: 1.5px solid var(--ink); border-radius: 50%; }
.photo-preview-list { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; max-width: min(480px, calc(100vw - 40px)); }
.photo-preview-wrap { position: relative; width: 84px; height: 62px; }
.photo-preview-wrap img { width: 100%; height: 100%; border: 2px solid white; border-radius: 10px; object-fit: cover; box-shadow: 0 5px 15px rgba(20,40,34,.15); }
.photo-preview-wrap .photo-preview-open { display: block; width: 100%; height: 100%; border: 0; padding: 0; background: transparent; cursor: zoom-in; }
.photo-preview-wrap .photo-preview-remove { position: absolute; top: -8px; right: -8px; display: grid; place-items: center; width: 24px; height: 24px; border: 0; border-radius: 50%; color: white; background: var(--ink); cursor: pointer; font-size: 18px; }
.capture-dialog { width: min(620px, calc(100% - 28px)); max-height: min(90vh, 820px); border: 0; border-radius: 22px; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(15,31,26,.28); }
.capture-dialog::backdrop { background: rgba(19,39,33,.6); backdrop-filter: blur(3px); }
.capture-dialog-header { display: flex; align-items: start; justify-content: space-between; gap: 20px; padding: 26px 30px 18px; border-bottom: 1px solid var(--line); }
.capture-dialog-header h2 { margin: 2px 0 0; font-family: Georgia, serif; font-size: 30px; font-weight: 500; }
.capture-dialog-header .dialog-close { position: static; flex: 0 0 auto; }
.capture-dialog-body { display: grid; gap: 23px; overflow-y: auto; max-height: calc(90vh - 205px); padding: 22px 30px 28px; }
.capture-facts { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capture-facts > div { display: grid; align-content: start; gap: 5px; min-width: 0; border: 1px solid var(--line); border-radius: 13px; padding: 13px 15px; background: white; }
.capture-facts small, .capture-facts span { color: var(--muted); font-size: 11px; }
.capture-facts strong { overflow-wrap: anywhere; font-size: 13px; }
.capture-facts .text-button { justify-self: start; font-size: 11px; }
.capture-photo-section { display: grid; gap: 12px; }
.capture-photo-section p { margin: 0; color: var(--muted); font-size: 13px; line-height: 1.4; }
.capture-section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.capture-section-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.capture-section-heading small { color: var(--muted); font-size: 11px; }
.capture-photo-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.capture-photo-actions .photo-button { min-width: 0; min-height: 73px; background: white; }
.capture-photo-actions .camera-action { border-color: var(--green); background: #eaf4ef; }
.capture-dialog .photo-preview-list { justify-content: flex-start; max-width: 100%; padding: 8px 0; }
.capture-dialog .note-field { width: 100%; margin: 0; }
.capture-dialog .note-field textarea { min-height: 88px; background: white; }
.capture-dialog-footer { display: grid; gap: 6px; padding: 15px 30px 20px; border-top: 1px solid var(--line); background: var(--paper); }
.capture-dialog-footer .primary-button { width: 100%; }
.capture-dialog-footer .permission-error { margin: 0 0 6px; }
.capture-dialog-footer .text-button { justify-self: center; }
.note-field { position: relative; z-index: 3; display: grid; gap: 7px; width: min(360px, 100%); margin-top: 14px; text-align: left; }
.note-field > span { display: flex; align-items: center; justify-content: space-between; padding: 0 3px; font-size: 12px; }
.note-field small { color: var(--muted); font-size: 10px; font-weight: 700; letter-spacing: .5px; text-transform: uppercase; }
.note-field textarea { width: 100%; min-height: 62px; resize: vertical; border: 1px solid var(--line); border-radius: 12px; padding: 11px 13px; outline: none; color: var(--ink); background: rgba(255,255,255,.65); }
.note-field textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,107,88,.10); background: white; }
.privacy-note { position: relative; z-index: 2; display: flex; align-items: center; gap: 6px; margin-top: 13px; color: #7b817d; font-size: 11px; }

.recent-section { max-width: 900px; margin: 0 auto; padding: 58px 30px 90px; border-top: 1px solid rgba(23,52,46,.12); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.section-heading h2 { margin: 0; font-family: Georgia, serif; font-size: 32px; font-weight: 500; letter-spacing: -1px; }
.text-button { border: 0; padding: 8px 0; color: var(--green); background: transparent; cursor: pointer; font-size: 13px; font-weight: 800; }
.recent-list, .activity-list { display: grid; grid-auto-rows: max-content; align-content: start; }
.entry-card { display: grid; grid-template-columns: 78px 18px minmax(0, 1fr) auto; align-items: center; gap: 16px; min-height: 105px; padding: 15px 0; border-bottom: 1px solid var(--line); }
.entry-card time { font-family: Georgia, serif; font-size: 19px; }
.entry-marker { position: relative; width: 13px; height: 13px; border: 3px solid var(--paper); border-radius: 50%; background: var(--coral); box-shadow: 0 0 0 1px var(--coral); }
.entry-marker::after { content: ""; position: absolute; z-index: -1; width: 1px; height: 92px; top: 12px; left: 3px; background: var(--line); }
.entry-card:last-child .entry-marker::after { display: none; }
.entry-details { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; min-width: 0; overflow-wrap: anywhere; }
.entry-details > * { flex-shrink: 0; max-width: 100%; }
.entry-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 12px; width: 100%; }
.entry-details strong { font-size: 14px; }
.entry-details span { color: var(--muted); font-size: 12px; }
.entry-details .location-unavailable { width: fit-content; border-radius: 999px; padding: 4px 8px; color: #8a4b37; background: #f7e4dc; font-size: 10px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.entry-details .manual-location-status { width: fit-content; border-radius: 999px; padding: 4px 8px; color: #235847; background: #e3f0e9; font-size: 10px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.entry-details .entry-note { max-width: 440px; margin: 4px 0 0; color: var(--ink); font-size: 12px; line-height: 1.45; white-space: pre-wrap; }
.entry-details .entry-department { width: fit-content; border-radius: 999px; padding: 4px 8px; color: #4e4a3d; background: #eee9dc; font-size: 10px; font-weight: 800; }
.entry-details .merged-status { width: fit-content; border-radius: 999px; padding: 4px 8px; color: #235847; background: #e3f0e9; font-size: 10px; font-weight: 800; letter-spacing: .35px; text-transform: uppercase; }
.entry-details a { overflow: hidden; max-width: 250px; color: var(--green); font-size: 11px; text-overflow: ellipsis; white-space: nowrap; }
.edit-location-button { width: fit-content; max-width: 100%; min-height: 28px; border: 0; border-bottom: 1px solid currentColor; padding: 4px 0; color: var(--green); background: transparent; cursor: pointer; font-size: 11px; font-weight: 750; line-height: 1.4; }
.edit-location-button:hover { color: var(--coral); }
.entry-photo-list { display: flex; gap: 7px; max-width: 240px; padding: 4px; overflow-x: auto; overscroll-behavior-inline: contain; scrollbar-width: thin; }
.entry-photo-button { position: relative; overflow: hidden; width: 76px; height: 64px; border: 0; border-radius: 10px; padding: 0; background: #e5e1d9; cursor: zoom-in; box-shadow: 0 0 0 1px rgba(23,52,46,.06); }
.entry-photo-count { position: absolute; right: 4px; bottom: 4px; border-radius: 5px; padding: 2px 5px; color: white; background: rgba(12,29,24,.8); font-size: 10px; font-weight: 800; }
.entry-photo-list .entry-photo-button { flex: 0 0 auto; }
.entry-photo-button:focus-visible { outline: 3px solid rgba(45,107,88,.35); outline-offset: 3px; }
.entry-photo { display: block; width: 100%; height: 100%; object-fit: cover; transition: transform .2s ease; }
.entry-photo-button:hover .entry-photo { transform: scale(1.05); }
.empty-state { display: grid; justify-items: center; gap: 13px; padding: 40px 20px; border: 1px dashed #ccc5b8; border-radius: 15px; color: var(--muted); text-align: center; }
.empty-state p { margin: 0; }
.empty-pin { width: 26px; height: 26px; border: 2px solid var(--sage); border-radius: 50% 50% 50% 10%; transform: rotate(-45deg); }

.activity-dialog { width: min(680px, calc(100% - 30px)); max-height: min(820px, calc(100vh - 30px)); border: 0; border-radius: 22px; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(15,31,26,.28); }
.activity-dialog[open] { display: flex; flex-direction: column; }
.activity-dialog.is-map-view { height: min(900px, calc(100vh - 30px)); height: min(900px, calc(100dvh - 30px)); }
.activity-dialog > .activity-header, .activity-dialog > .date-control { flex-shrink: 0; }
.activity-header { display: grid; grid-template-columns: minmax(0, 1fr) auto 40px; align-items: center; gap: 8px; padding: 14px 18px 10px; }
.activity-header h2 { margin: 0; font-size: 18px; font-weight: 750; white-space: nowrap; }
.activity-dialog::backdrop { background: rgba(19,39,33,.56); backdrop-filter: blur(3px); }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 30px 34px 22px; }
.dialog-header h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -1px; }
.dialog-close { width: 40px; height: 40px; border: 1px solid var(--line); border-radius: 50%; background: white; cursor: pointer; font-size: 25px; font-weight: 300; line-height: 1; }
.date-control { display: grid; grid-template-columns: 42px 1fr 42px; align-items: end; gap: 8px; padding: 0 18px 12px; }
.date-control button { height: 42px; border: 1px solid var(--line); border-radius: 10px; background: white; cursor: pointer; }
.date-control label { display: grid; gap: 6px; color: var(--muted); font-size: 11px; font-weight: 800; letter-spacing: .5px; text-transform: uppercase; }
.date-control input { height: 42px; border: 1px solid var(--line); border-radius: 10px; padding: 0 12px; color: var(--ink); background: white; }
.activity-list { overflow-y: auto; min-height: 0; max-height: 520px; padding: 0 34px 25px; }
.activity-list .empty-state { margin-top: 22px; }
.activity-view-switch { display: flex; gap: 4px; }
.activity-view-switch button { min-height: 36px; min-width: 48px; border: 1px solid var(--line); border-radius: 9px; padding: 6px 10px; color: var(--muted); background: white; cursor: pointer; font: inherit; font-size: 12px; font-weight: 800; }
.activity-view-switch button[aria-pressed="true"] { border-color: var(--green); color: white; background: var(--green); }
.activity-map-panel { display: flex; flex: 1; flex-direction: column; gap: 10px; min-height: 0; overflow-y: auto; padding: 0 14px 14px; }
.activity-map-status { flex-shrink: 0; margin: 0; padding: 14px 4px; color: var(--muted); font-size: 12px; line-height: 1.5; }
.activity-map-frame { position: relative; flex: 1 1 auto; width: 100%; height: min(570px, 65vh); height: min(570px, 65dvh); min-height: 240px; }
.activity-map { position: relative; z-index: 0; width: 100%; height: 100%; border: 1px solid var(--line); border-radius: 13px; background: #e7eee8; font: inherit; }
.activity-map-fit { position: absolute; z-index: 2; top: 12px; right: 12px; display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; box-shadow: 0 2px 8px rgba(15,31,26,.15); cursor: pointer; }
.activity-map-fit:hover { background: #eef4f0; }
.activity-map-fit:disabled { opacity: .5; cursor: default; }
.activity-map-warning { flex-shrink: 0; }
.activity-map-warning { margin: 0; border-radius: 8px; padding: 8px 10px; color: #923c2d; background: #fff0ec; font-size: 12px; }
.activity-map-pin { display: grid; place-items: start center; background: transparent; }
.activity-map-pin > span { display: grid; place-items: center; width: 32px; height: 32px; border: 2px solid white; border-radius: 50% 50% 50% 4px; color: white; background: var(--event-color, var(--coral)); box-shadow: 0 3px 7px rgba(15,31,26,.3); transform: rotate(-45deg); font-size: 16px; font-weight: 800; }
.activity-map-pin > span > b { transform: rotate(45deg); }
.activity-map-pin--manual > span { border: 3px solid var(--event-color, var(--green)); background: var(--paper); color: var(--event-color, var(--green)); }
.activity-map-pin--selected > span { box-shadow: 0 0 0 4px rgba(23,52,46,.25), 0 3px 7px rgba(15,31,26,.3); }
.activity-map-pin-count { position: absolute; top: -9px; right: -10px; border: 2px solid white; border-radius: 999px; padding: 1px 4px; color: white; background: var(--ink); font-size: 10px; font-weight: 800; }
.activity-map-pin:focus-visible { outline: 3px solid var(--ink); outline-offset: 3px; border-radius: 6px; }
.activity-map .leaflet-control-attribution { font-size: 10px; }
.activity-map-popup { color: var(--ink); font: 13px Inter, ui-sans-serif, system-ui, sans-serif; }
.activity-map-popup-heading { display: block; margin-bottom: 8px; }
.activity-map-popup .entry-card { grid-template-columns: 1fr auto; gap: 6px 10px; min-height: 0; padding: 12px 0; }
.activity-map-popup .entry-card time { grid-column: 1 / -1; font-size: 18px; }
.activity-map-popup .entry-marker, .activity-map-popup .entry-details > strong { display: none; }
.activity-map-popup .entry-note { overflow-wrap: anywhere; }
.activity-map-popup .entry-photo-button { width: 60px; height: 60px; }
.activity-map-popup .entry-card time { display: none; }
.activity-map-event { border-radius: 8px; padding: 7px; }
.activity-map-event.is-selected { background: #eef4f0; }
.activity-map-event-select { border: 0; padding: 5px 0; color: var(--green); background: transparent; cursor: pointer; font: inherit; font-weight: 800; text-align: left; }
.activity-map .activity-map-gap { border: 0; border-radius: 5px; padding: 3px 5px; color: #3a5148; background: rgba(255,253,248,.9); box-shadow: 0 1px 4px rgba(15,31,26,.13); font-size: 10px; pointer-events: none; }
.activity-map .activity-map-gap::before { display: none; }
.activity-timeline-section { flex-shrink: 0; border-top: 1px solid var(--line); padding-top: 12px; }
.activity-timeline-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
.activity-timeline-heading h3 { margin: 0; font-family: Georgia, serif; font-size: 21px; font-weight: 500; }
.activity-timeline-heading > span { color: var(--muted); font-size: 11px; }
.activity-timeline-scroll { overflow: auto; max-height: 220px; margin-top: 8px; scrollbar-width: thin; }
.activity-timeline-track { position: relative; }
.activity-timeline-axis { position: absolute; top: 16px; right: 50px; left: 50px; height: 2px; background: linear-gradient(to right, #c15230, #2d6b58); }
.activity-timeline-event { position: absolute; display: grid; justify-items: center; gap: 4px; width: 80px; min-height: 54px; border: 1px solid transparent; border-radius: 9px; padding: 4px; color: var(--ink); background: var(--paper); cursor: pointer; transform: translateX(-50%); }
.activity-timeline-event::before { content: ""; position: absolute; top: calc(-1 * var(--stem-length)); left: 50%; width: 1px; height: var(--stem-length); background: var(--event-color); }
.activity-timeline-event strong { display: grid; place-items: center; min-width: 25px; height: 25px; border-radius: 50%; padding: 0 4px; color: white; background: var(--event-color); font-size: 12px; }
.activity-timeline-event time { font-size: 11px; white-space: nowrap; }
.activity-timeline-event[aria-pressed="true"] { border-color: var(--ink); background: #eef4f0; box-shadow: inset 0 0 0 1px var(--ink); }
.activity-timeline-event--no-gps strong { border: 1px dashed var(--muted); color: var(--muted); background: white; }
.activity-timeline-selection { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 7px; }
.activity-timeline-selection p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.activity-timeline-selection .text-button { flex-shrink: 0; font-size: 11px; }

.photo-dialog { width: min(920px, calc(100% - 28px)); max-height: calc(100vh - 28px); border: 0; border-radius: 18px; padding: 0; color: white; background: #10241f; box-shadow: 0 28px 90px rgba(8,20,16,.52); }
.photo-dialog::backdrop { background: rgba(8,18,15,.82); backdrop-filter: blur(5px); }
.photo-dialog-close { position: absolute; z-index: 2; top: 14px; right: 14px; border-color: rgba(255,255,255,.35); color: white; background: rgba(10,28,22,.72); }
.photo-dialog figure { display: grid; justify-items: center; gap: 0; margin: 0; }
.photo-dialog img { display: block; width: 100%; max-height: calc(100vh - 90px); object-fit: contain; }
.photo-dialog figcaption { width: 100%; padding: 13px 20px; color: #d4dfda; background: #10241f; font-size: 12px; text-align: center; }
.photo-nav { position: absolute; z-index: 2; top: 45%; width: 42px; height: 54px; border: 0; border-radius: 8px; color: white; background: rgba(10,28,22,.72); cursor: pointer; font-size: 35px; }
.photo-nav--previous { left: 10px; }
.photo-nav--next { right: 10px; }

.admin-dialog { width: min(960px, calc(100% - 30px)); height: min(760px, calc(100vh - 30px)); border: 0; border-radius: 22px; padding: 0; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(15,31,26,.28); }
.admin-dialog::backdrop { background: rgba(19,39,33,.56); backdrop-filter: blur(3px); }
.admin-header { display: flex; align-items: center; justify-content: space-between; padding: 28px 32px 22px; border-bottom: 1px solid var(--line); }
.admin-header h2 { margin: 0; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -1px; }
.admin-layout { display: grid; grid-template-columns: 205px 1fr; height: calc(100% - 101px); }
.admin-nav { display: grid; align-content: start; gap: 5px; padding: 24px 16px; border-right: 1px solid var(--line); background: #f5f1e9; }
.admin-tab { border: 0; border-radius: 9px; padding: 11px 13px; color: var(--muted); background: transparent; cursor: pointer; font-size: 13px; font-weight: 750; text-align: left; }
.admin-tab:hover { background: rgba(255,255,255,.7); }
.admin-tab.is-active { color: white; background: var(--ink); }
.admin-content { overflow-y: auto; padding: 30px 34px 40px; }
.admin-section { max-width: 680px; }
.settings-form { display: grid; gap: 22px; }
.settings-block { display: grid; gap: 16px; border: 1px solid var(--line); border-radius: 15px; padding: 20px; background: white; }
.settings-heading { display: flex; align-items: center; justify-content: space-between; gap: 18px; }
.settings-heading h3 { margin: 0 0 4px; font-family: Georgia, serif; font-size: 23px; font-weight: 500; }
.settings-heading p { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.5; }
.field-label { display: grid; gap: 7px; color: var(--ink); font-size: 12px; font-weight: 750; }
.field-label input, .field-label select, .field-label textarea { width: 100%; min-height: 43px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; outline: none; color: var(--ink); background: var(--paper); }
.field-label textarea { resize: vertical; }
.field-label input:focus, .field-label select:focus, .field-label textarea:focus { border-color: var(--green); box-shadow: 0 0 0 3px rgba(45,107,88,.1); }
.field-label > small { color: var(--muted); font-size: 10px; font-weight: 500; }
.merge-threshold-field { max-width: 260px; padding-top: 4px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 20px; cursor: pointer; }
.toggle-row > span { display: grid; gap: 3px; }
.toggle-row strong { font-size: 13px; }
.toggle-row small { color: var(--muted); font-size: 11px; line-height: 1.4; }
.toggle-row input { position: absolute; opacity: 0; pointer-events: none; }
.toggle-row i { position: relative; width: 43px; height: 24px; flex: 0 0 auto; border-radius: 999px; background: #c7c9c5; transition: background .2s; }
.toggle-row i::after { content: ""; position: absolute; width: 18px; height: 18px; top: 3px; left: 3px; border-radius: 50%; background: white; box-shadow: 0 1px 4px rgba(0,0,0,.22); transition: transform .2s; }
.toggle-row input:checked + i { background: var(--green); }
.toggle-row input:checked + i::after { transform: translateX(19px); }
.toggle-row input:focus-visible + i { outline: 3px solid rgba(45,107,88,.22); outline-offset: 2px; }
.settings-save { width: fit-content; min-width: 190px; border: 0; padding: 0 20px; }
.settings-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.settings-actions .secondary-button { padding: 0 18px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.form-grid-wide { grid-column: 1 / -1; }
.small-button { border: 1px solid var(--line); border-radius: 8px; padding: 8px 11px; background: white; cursor: pointer; font-size: 11px; font-weight: 750; }
.danger-button { border-color: #e1b3a8; color: #994534; background: #fff0ec; }
.inline-form { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; }
.inline-form > input { min-width: 0; min-height: 45px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 11px; background: white; }
.check-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
.check-grid label { display: flex; align-items: center; gap: 8px; border: 1px solid var(--line); border-radius: 9px; padding: 9px 10px; background: white; font-size: 12px; }
.management-list { display: grid; margin-top: 18px; border-top: 1px solid var(--line); }
.management-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 15px 2px; border-bottom: 1px solid var(--line); }
.management-row > div:first-child { min-width: 0; display: grid; gap: 4px; }
.management-row strong, .management-row small { overflow-wrap: anywhere; }
.management-row small { color: var(--muted); font-size: 11px; line-height: 1.45; }
.management-actions { display: flex; align-items: center; justify-content: flex-end; gap: 7px; flex-wrap: wrap; }
.management-actions select { max-width: 130px; border: 1px solid var(--line); border-radius: 8px; padding: 7px 8px; background: white; font-size: 11px; }
.copy-result { border-radius: 10px; padding: 12px 14px; color: var(--green); background: #eaf4ef; font-size: 12px; overflow-wrap: anywhere; }
.admin-user-list { display: grid; margin-top: 18px; border-top: 1px solid var(--line); }
.admin-user-row { display: grid; grid-template-columns: 38px minmax(0,1fr) auto; align-items: center; gap: 12px; padding: 16px 3px; border-bottom: 1px solid var(--line); }
.admin-user-details { min-width: 0; display: grid; gap: 3px; }
.admin-user-details > div { display: flex; align-items: center; gap: 8px; }
.admin-user-details strong, .admin-user-details small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-user-details small { color: var(--muted); font-size: 11px; }
.role-badge { border-radius: 999px; padding: 3px 7px; font-size: 9px; font-weight: 850; letter-spacing: .5px; text-transform: uppercase; }
.role-badge--owner { color: #775120; background: #f6e7c7; }
.role-badge--global_admin { color: #5c3c7a; background: #eee3f7; }
.role-badge--user { color: var(--green); background: #e0eee8; }
.user-state-button { min-width: 78px; border: 1px solid #e1b3a8; border-radius: 999px; padding: 7px 10px; color: #994534; background: #fff0ec; cursor: pointer; font-size: 10px; font-weight: 800; }
.user-state-button.is-active { border-color: #a9c8ba; color: var(--green); background: #eaf4ef; }

.permission-dialog { position: relative; width: min(460px, calc(100% - 30px)); border: 0; border-radius: 22px; padding: 42px 40px 36px; color: var(--ink); background: var(--paper); box-shadow: 0 28px 80px rgba(15,31,26,.28); text-align: center; }
.permission-dialog::backdrop { background: rgba(19,39,33,.56); backdrop-filter: blur(3px); }
.permission-close { position: absolute; top: 18px; right: 18px; }
.permission-symbol { display: grid; place-items: center; width: 68px; height: 68px; margin: 0 auto 24px; border-radius: 50%; color: var(--coral); background: #f9e7df; }
.permission-symbol::before { content: ""; width: 23px; height: 23px; border: 3px solid currentColor; border-radius: 50% 50% 50% 10%; transform: rotate(-45deg); }
.permission-symbol span { position: absolute; width: 32px; height: 3px; border-radius: 3px; background: currentColor; transform: rotate(-45deg); }
.permission-dialog h2 { margin: 0 0 12px; font-family: Georgia, serif; font-size: 34px; font-weight: 500; letter-spacing: -1px; }
.permission-dialog > p:not(.eyebrow):not(.permission-error) { margin: 0 auto 22px; color: var(--muted); line-height: 1.6; }
.permission-actions { display: grid; gap: 10px; margin-top: 20px; }
.permission-actions .primary-button { width: 100%; }
.permission-actions .primary-button + .primary-button { border: 1px solid var(--ink); color: var(--ink); background: transparent; box-shadow: none; }
.permission-actions .primary-button + .primary-button:hover { color: white; background: var(--ink); }
.merge-dialog { width: min(540px, calc(100% - 30px)); }
.merge-form { display: grid; gap: 18px; text-align: left; }
.merge-form fieldset { display: grid; gap: 9px; margin: 0; border: 0; padding: 0; }
.merge-form legend { margin-bottom: 8px; font-size: 12px; font-weight: 800; }
.merge-choice { display: flex; align-items: flex-start; gap: 10px; border: 1px solid var(--line); border-radius: 11px; padding: 11px 13px; cursor: pointer; background: white; }
.merge-choice:has(input:checked) { border-color: var(--green); box-shadow: 0 0 0 2px rgba(45,107,88,.1); }
.merge-choice input { margin-top: 2px; accent-color: var(--green); }
.merge-choice span { font-size: 12px; line-height: 1.45; }
.merge-actions { grid-template-columns: 1fr 1fr; }
.merge-actions .secondary-button { width: 100%; }
.secondary-button { min-height: 49px; border: 1px solid var(--line); border-radius: 10px; color: var(--ink); background: white; cursor: pointer; font-weight: 800; }
.secondary-button:hover { border-color: var(--sage); background: #f8f5ee; }
.permission-dialog > small { display: block; margin-top: 18px; color: #7a827d; line-height: 1.5; }
.permission-error { margin: -6px 0 12px; border-radius: 8px; padding: 10px 12px; color: #923c2d; background: #fff0ec; font-size: 12px; }
.manual-location-dialog { text-align: left; }
.manual-location-dialog .eyebrow, .manual-location-dialog h2, .manual-location-dialog > p { text-align: center; }
.manual-location-form { display: grid; gap: 20px; }
.manual-location-form .permission-error { margin: 0; }
.manual-location-form .primary-button { width: 100%; }

.toast { position: fixed; z-index: 100; right: 24px; bottom: 24px; max-width: min(390px, calc(100% - 32px)); border-radius: 12px; padding: 14px 18px; color: white; background: var(--green); box-shadow: var(--shadow); opacity: 0; transform: translateY(12px); transition: opacity .22s, transform .22s; font-size: 14px; font-weight: 700; }
.toast[data-kind="error"] { background: #a94332; }
.toast.is-visible { opacity: 1; transform: translateY(0); }

@media (pointer: coarse) {
  /* iOS Safari zooms the page when focusing form controls smaller than 16px. */
  input:not([type="checkbox"]):not([type="radio"]):not([type="file"]):not([type="hidden"]),
  textarea:not([readonly]),
  select:not([multiple]) { font-size: 16px; }
}

@media (max-width: 860px) {
  .auth-shell { display: block; }
  .auth-intro { display: none; }
  .auth-panel { min-height: 100vh; padding: 32px 22px; }
  .mobile-brand { display: flex; align-items: center; gap: 9px; margin-bottom: 50px; font-family: Georgia, serif; font-size: 22px; font-weight: 700; }
  .capture-zone { min-height: 610px; padding-top: 58px; }
  .admin-layout { grid-template-columns: 170px 1fr; }
}

@media (max-width: 600px) {
  .app-header { height: 70px; padding: 0 18px; }
  .today-label { display: none; }
  .capture-zone { min-height: 680px; padding: 49px 18px 45px; }
  .capture-dialog, .activity-dialog {
    position: fixed;
    inset: 0;
    width: calc(100% - 24px);
    max-width: none;
    max-height: calc(100vh - 24px);
    max-height: calc(100dvh - 24px);
    margin: auto;
    border-radius: 22px;
  }
  .activity-dialog.is-map-view { height: calc(100vh - 24px); height: calc(100dvh - 24px); }
  .activity-header { padding: 10px 12px 8px; }
  .activity-header h2 { font-size: 17px; }
  .capture-dialog-header { padding: 22px 20px 15px; }
  .capture-dialog-body { max-height: calc(96dvh - 195px); padding: 18px 20px 25px; }
  .capture-dialog-footer { padding: 12px 20px max(16px, env(safe-area-inset-bottom)); }
  .capture-photo-actions { grid-template-columns: 1fr; }
  .capture-facts { grid-template-columns: 1fr; }
  .capture-zone::before { width: 500px; height: 500px; }
  .capture-copy h1 { font-size: 44px; }
  .log-wrap { width: 225px; height: 225px; margin: 23px 0 13px; }
  .orbit--one { width: 218px; height: 218px; }
  .orbit--two { width: 196px; height: 196px; }
  .log-button { width: 164px; height: 164px; }
  .recent-section { padding: 42px 19px 70px; }
  .section-heading h2 { font-size: 28px; }
  .entry-card { grid-template-columns: 65px 15px minmax(0, 1fr) auto; gap: 10px; }
  .entry-photo-list { max-width: 124px; }
  .entry-photo-button { width: 56px; height: 54px; }
  .photo-dialog { width: 100%; max-height: 100vh; border-radius: 0; }
  .photo-dialog img { max-height: calc(100vh - 64px); }
  .admin-dialog { width: 100%; height: 94vh; max-height: none; margin: auto 0 0; border-radius: 22px 22px 0 0; }
  .admin-header { padding: 22px 20px 17px; }
  .admin-layout { grid-template-columns: 1fr; height: calc(100% - 89px); }
  .admin-nav { display: flex; overflow-x: auto; padding: 10px; border-right: 0; border-bottom: 1px solid var(--line); scrollbar-width: thin; }
  .admin-tab { flex: 0 0 auto; padding: 9px 12px; text-align: center; font-size: 10px; }
  .admin-content { padding: 22px 18px 32px; }
  .settings-block { padding: 16px; }
  .form-grid { grid-template-columns: 1fr; }
  .form-grid-wide { grid-column: auto; }
  .admin-user-row { grid-template-columns: 36px minmax(0,1fr); }
  .admin-user-row .management-actions { grid-column: 2; justify-content: flex-start; }
  .management-row { align-items: flex-start; flex-direction: column; }
  .management-actions { justify-content: flex-start; }
  .inline-form { grid-template-columns: 1fr; }
  .check-grid { grid-template-columns: 1fr; }
  .permission-dialog { width: calc(100% - 24px); padding: 42px 24px 30px; }
  .dialog-header { padding: 25px 22px 19px; }
  .date-control { padding: 0 14px 10px; }
  .activity-map-panel { padding: 0 10px 12px; }
  .activity-list { padding: 0 22px 25px; }
  .toast { right: 16px; bottom: 16px; }
}

@media (max-height: 500px) {
  .activity-dialog[open] { overflow-y: hidden; }
  .activity-list { flex: 1; max-height: none; overflow-y: auto; }
  .activity-map-panel { overflow-y: auto; }
  .activity-map-frame { flex: 0 0 auto; height: 320px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
}
