:root {
  color-scheme: light;
  --bg: #f3f6f5;
  --surface: #ffffff;
  --surface-strong: #eef5f1;
  --ink: #15231f;
  --muted: #60716c;
  --line: #d6e0dc;
  --green: #0f6b5f;
  --green-strong: #084f47;
  --blue: #2f6f9f;
  --amber: #d88728;
  --coral: #d85f45;
  --shadow: 0 12px 32px rgba(21, 35, 31, .1);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Meiryo", system-ui, sans-serif;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); color: var(--ink); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }

.app-shell { min-height: 100vh; padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
.topbar {
  align-items: center;
  background: rgba(255,255,255,.94);
  border-bottom: 1px solid var(--line);
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 14px clamp(14px, 4vw, 38px);
  position: sticky;
  top: 0;
  z-index: 20;
  backdrop-filter: blur(14px);
}
.brand { align-items: center; display: flex; gap: 12px; min-width: 0; }
.brand strong { display: block; font-size: clamp(18px, 4vw, 26px); line-height: 1.1; }
.brand-mark {
  align-items: center;
  background: var(--green);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  font-weight: 900;
  height: 42px;
  justify-content: center;
  width: 42px;
}
.brand-mark-logo { background: #fff; border: 1px solid var(--line); overflow: hidden; padding: 3px; }
.brand-logo { display: block; height: 100%; object-fit: contain; width: 100%; }
.eyebrow {
  color: var(--muted);
  display: block;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  line-height: 1.3;
}
.topnav { align-items: center; display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.mobile-notification-link { display: none; }
.notification-badge {
  align-items: center;
  background: var(--coral);
  border-radius: 999px;
  color: #fff;
  display: inline-flex;
  font-size: 11px;
  font-weight: 900;
  height: 22px;
  justify-content: center;
  margin-left: 5px;
  min-width: 22px;
  padding: 0 6px;
}
.topnav a, .button, .primary-button, .secondary-button, .ghost-button, .file-button {
  align-items: center;
  border: 1px solid transparent;
  border-radius: 8px;
  display: inline-flex;
  font-weight: 800;
  justify-content: center;
  min-height: 40px;
  padding: 9px 12px;
}
.topnav a, .secondary-button, .file-button { background: var(--surface-strong); border-color: var(--line); }
.primary-button { background: var(--green); color: #fff; width: 100%; }
.ghost-button { background: transparent; border-color: var(--line); color: var(--muted); }
.danger { color: #a13a2b; }
.main-area { margin: 0 auto; max-width: 1180px; padding: 18px clamp(12px, 3vw, 28px) 28px; }
h1, h2, h3, p { margin: 0; }
h1 { font-size: clamp(24px, 5vw, 38px); line-height: 1.12; }
h2 { font-size: clamp(20px, 4vw, 28px); line-height: 1.2; }
h3 { font-size: 17px; line-height: 1.3; }
.section-head { align-items: center; display: flex; gap: 12px; justify-content: space-between; margin-bottom: 14px; }
.grid-2 { display: grid; gap: 16px; grid-template-columns: minmax(0, 1fr) minmax(300px, 380px); }
.grid-3 { display: grid; gap: 12px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.panel, .card, .measure-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: clamp(14px, 2.5vw, 20px);
}
.stack { display: grid; gap: 12px; }
.form-grid { display: grid; gap: 12px; }
label { color: var(--muted); display: grid; font-size: 13px; font-weight: 800; gap: 6px; }
input, select, textarea {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  min-height: 42px;
  padding: 9px 10px;
  width: 100%;
}
textarea { resize: vertical; }
.toggle-row { align-items: center; display: flex; gap: 8px; }
.toggle-row input { accent-color: var(--green); min-height: auto; width: auto; }
.password-visibility { color: var(--muted); font-size: 13px; font-weight: 800; }
.notice { border-radius: 8px; font-weight: 800; margin-bottom: 12px; padding: 12px; }
.notice.success { background: #e6f5ed; color: #115b42; }
.notice.error { background: #fff0ec; color: #a13a2b; }
.notice.caution { background: #fff6df; color: #76521c; }
.ad-slot {
  align-items: center;
  background: repeating-linear-gradient(135deg,#fbf7ed,#fbf7ed 10px,#f4ecdc 10px,#f4ecdc 20px);
  border: 1px dashed #c5a06e;
  border-radius: 8px;
  color: #806138;
  display: flex;
  font-size: 13px;
  font-weight: 800;
  justify-content: center;
}
.ad-slot-top { height: 54px; margin: 12px auto 0; max-width: 760px; width: calc(100% - 24px); }
.ad-slot-card { height: 210px; }
.ad-slot-ranking { height: 90px; margin: 16px auto 0; max-width: 760px; width: calc(100% - 24px); }
.ad-slot-live { background: #fff; border-style: solid; overflow: hidden; padding: 0; position: relative; }
.ad-creative { display: block; height: 100%; position: relative; width: 100%; }
.ad-creative img { display: block; height: 100%; object-fit: contain; width: 100%; }
.ad-disclosure {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(21,40,35,.18);
  border-radius: 4px;
  color: #344b45;
  font-size: 10px;
  font-weight: 800;
  padding: 2px 5px;
  position: absolute;
  right: 5px;
  top: 5px;
}
.photo-stage { aspect-ratio: 16 / 9; background: #dfe8e4; border: 1px solid var(--line); border-radius: 8px; overflow: hidden; width: 100%; }
.photo-source-group { border: 0; margin: 0; min-width: 0; padding: 0; }
.photo-source-group legend { color: var(--muted); font-size: 13px; font-weight: 800; margin-bottom: 6px; padding: 0; }
.photo-source-group input[type="file"] { min-width: 0; width: 100%; }
.field-help { color: var(--muted); font-size: 12px; line-height: 1.5; margin: 7px 0 0; }
.photo-compression-status {
  background: #edf3f1;
  border-left: 4px solid #78928a;
  color: #42554f;
  font-size: 12px;
  font-weight: 800;
  line-height: 1.55;
  margin: 10px 0 0;
  padding: 9px 11px;
}
.photo-compression-status.is-processing { background: #fff6df; border-left-color: #d39a2d; color: #76521c; }
.photo-compression-status.is-success { background: #e6f5ed; border-left-color: #23845f; color: #115b42; }
.photo-compression-status.is-error { background: #fff0ec; border-left-color: #c84e3b; color: #a13a2b; }
.share-scope-policy {
  background: #e9f2fa;
  border-left: 4px solid var(--blue);
  border-radius: 8px;
  color: #225d87;
  font-size: 13px;
  font-weight: 800;
  line-height: 1.6;
  padding: 10px 12px;
}
.share-scope-policy[data-scope="public"] { background: #e6f5ed; border-left-color: var(--green); color: #115b42; }
.share-scope-policy[data-scope="private"] { background: #f0f1f1; border-left-color: #6b7773; color: #4f5c58; }
.catch-policy-warning { color: #9a4c25; font-weight: 800; }
.install-app-panel { margin-top: 28px; }
.install-app-panel .secondary-button { width: 100%; }
.account-details { display: grid; gap: 0; margin: 0; }
.account-details div { border-bottom: 1px solid var(--line); display: grid; gap: 4px; padding: 10px 0; }
.account-details div:last-child { border-bottom: 0; }
.account-details dt { color: var(--muted); font-size: .82rem; font-weight: 800; }
.account-details dd { font-weight: 800; margin: 0; overflow-wrap: anywhere; }
.danger-zone { border-color: #e7b8ad; margin-top: 16px; }
.audit-filter { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(4, minmax(130px, 1fr)); }
.audit-filter-query { grid-column: span 3; }
.audit-table .audit-summary { max-width: 420px; white-space: normal; }
.audit-summary details { margin-top: 7px; }
.audit-summary summary { color: var(--green-strong); cursor: pointer; font-size: 12px; font-weight: 800; }
.audit-summary pre { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 6px; font-size: 11px; max-width: 420px; overflow: auto; padding: 8px; white-space: pre-wrap; }
.login-register-button { width: 100%; }
.text-link { color: var(--green-strong); font-weight: 800; text-decoration: underline; text-underline-offset: 3px; }
.legal-consent-row { align-items: flex-start; line-height: 1.6; }
.legal-document { line-height: 1.8; }
.legal-document h2 { font-size: 20px; margin-top: 16px; }
.legal-document ul { margin: 0; padding-left: 24px; }
.legal-footer { align-items: center; color: var(--muted); display: flex; flex-wrap: wrap; font-size: 12px; gap: 16px; justify-content: center; padding: 20px 12px 8px; }
.legal-footer a { text-decoration: underline; text-underline-offset: 3px; }
.install-app-message { background: var(--surface-strong); border-left: 3px solid var(--green); color: var(--muted); font-size: 13px; line-height: 1.6; padding: 10px; }
.install-guide { inset: 0; position: fixed; z-index: 1000; }
.install-guide-backdrop { background: rgba(13, 35, 32, .55); border: 0; border-radius: 0; inset: 0; min-height: 0; padding: 0; position: absolute; width: 100%; }
.install-guide-sheet { background: #fff; border: 1px solid var(--line); border-radius: 8px 8px 0 0; bottom: 0; box-shadow: 0 -12px 32px rgba(13, 35, 32, .18); left: 0; margin: 0 auto; max-width: 620px; padding: 20px max(20px, env(safe-area-inset-right)) max(24px, env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left)); position: absolute; right: 0; }
.install-guide-heading { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.install-guide-heading h3 { font-size: 20px; margin: 0; }
.install-guide-close { align-items: center; background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; display: inline-flex; font-size: 25px; height: 42px; justify-content: center; line-height: 1; min-height: 42px; padding: 0; width: 42px; }
.install-guide-sheet > p { color: var(--muted); line-height: 1.7; }
.install-guide-steps { display: grid; gap: 10px; line-height: 1.7; margin: 16px 0 20px; padding-left: 24px; }
.install-guide-sheet > .secondary-button { width: 100%; }
.location-fieldset { border: 1px solid var(--line); margin: 0; min-width: 0; padding: 12px; }
.location-fieldset legend { color: var(--muted); font-size: 13px; font-weight: 800; padding: 0 5px; }
.location-actions { display: flex; flex-wrap: wrap; gap: 8px; }
.location-status { color: var(--muted); font-size: 13px; line-height: 1.5; margin: 9px 0; }
.location-status.is-success { color: var(--green-strong); font-weight: 800; }
.location-status.is-error { color: #a13a2b; font-weight: 800; }
#measureCanvas { display: block; height: 100%; touch-action: none; width: 100%; }
.tool-row, .inline-controls { display: flex; flex-wrap: wrap; gap: 8px; }
.segmented-control { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); padding: 3px; }
.segmented-control a { align-items: center; border-radius: 6px; color: var(--muted); display: flex; font-size: 13px; font-weight: 900; justify-content: center; min-height: 38px; padding: 7px 12px; }
.segmented-control a.is-active { background: #fff; box-shadow: 0 1px 4px rgba(21,35,31,.12); color: var(--green-strong); }
.friend-section { margin-top: 16px; }
.friend-list { border-top: 1px solid var(--line); display: grid; }
.friend-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 12px; justify-content: space-between; min-width: 0; padding: 12px 0; }
.friend-row > div:first-child { display: grid; gap: 4px; min-width: 0; }
.friend-row strong { overflow-wrap: anywhere; }
.friend-row span:not(.tag) { color: var(--muted); font-size: 12px; }
.friend-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; justify-content: flex-end; }
.friend-actions form, .friend-row > form { margin: 0; }
.friend-search { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(0, 1fr) auto; }
.notification-list { display: grid; gap: 10px; margin-top: 16px; }
.notification-item {
  align-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  padding: 15px;
}
.notification-item.is-unread { border-left: 5px solid var(--green); }
.notification-item.is-important { background: #fffaf0; }
.notification-copy { display: grid; gap: 7px; min-width: 0; }
.notification-title-row { align-items: center; display: flex; flex-wrap: wrap; gap: 7px; }
.notification-title-row strong { overflow-wrap: anywhere; }
.notification-unread-dot { background: var(--green); border-radius: 50%; height: 9px; width: 9px; }
.notification-important-tag { background: #fff0d4; color: #76521c; }
.notification-body { color: #33443f; font-size: 14px; line-height: 1.7; overflow-wrap: anywhere; }
.notification-meta { color: var(--muted); font-size: 12px; }
.notification-actions { flex: 0 0 auto; margin: 0; }
.admin-form-panel { margin-top: 16px; }
.announcement-admin-list { border-top: 1px solid var(--line); display: grid; }
.announcement-admin-row { align-items: center; border-bottom: 1px solid var(--line); display: flex; gap: 14px; justify-content: space-between; padding: 13px 0; }
.announcement-admin-copy { display: grid; gap: 6px; min-width: 0; }
.announcement-admin-copy p { color: #33443f; font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.announcement-admin-copy > span { color: var(--muted); font-size: 11px; line-height: 1.5; }
.marker-button { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; font-weight: 800; min-height: 38px; padding: 7px 10px; }
.marker-button.is-active { background: #e1f4ed; border-color: var(--green); color: var(--green-strong); }
.result-strip { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.result-strip > div, .stat-card { background: #f7faf9; border: 1px solid var(--line); border-radius: 8px; padding: 11px; }
.label { color: var(--muted); display: block; font-size: 12px; font-weight: 800; line-height: 1.3; }
.stat-card strong, .result-strip strong { display: block; font-size: 20px; line-height: 1.25; margin-top: 2px; }
.catch-list, .ranking-list, .feed-list, .fish-grid { display: grid; gap: 12px; }
.fish-grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
.catch-card, .feed-card, .rank-row, .fish-card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  display: grid;
  gap: 12px;
  padding: 12px;
}
.catch-card, .feed-card { grid-template-columns: 112px minmax(0, 1fr); }
.catch-photo { aspect-ratio: 4 / 3; background: var(--surface-strong); border-radius: 8px; object-fit: cover; width: 100%; }
.catch-title { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.catch-title strong { font-size: 17px; }
.catch-meta { color: var(--muted); font-size: 13px; line-height: 1.5; margin-top: 6px; }
.catch-actions { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.catch-actions form { margin: 0; }
.edit-photo-wrap { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.edit-catch-photo { aspect-ratio: 16 / 9; display: block; object-fit: contain; width: 100%; }
.analysis-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.4fr) minmax(300px, .8fr); }
.analysis-photo-wrap { background: var(--surface-strong); border: 1px solid var(--line); border-radius: 8px; overflow: hidden; }
.analysis-photo { aspect-ratio: 4 / 3; display: block; object-fit: contain; width: 100%; }
.analysis-result { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); display: grid; gap: 9px; padding: 14px 0; }
.analysis-result > strong { font-size: 26px; }
.analysis-result > p { color: var(--muted); font-size: 13px; line-height: 1.6; }
.confidence-row { color: var(--muted); display: flex; flex-wrap: wrap; font-size: 12px; font-weight: 800; gap: 8px; justify-content: space-between; }
.confidence-track { background: #e4ece9; border-radius: 4px; height: 8px; overflow: hidden; }
.confidence-track span { background: var(--blue); display: block; height: 100%; }
.tag { background: #eef5f1; border-radius: 999px; color: var(--green-strong); display: inline-flex; font-size: 12px; font-weight: 900; padding: 6px 8px; }
.rank-row { align-items: center; grid-template-columns: 54px minmax(0, 1fr) auto; }
.rank-row.is-current-user { border-color: var(--green); box-shadow: 0 0 0 2px rgba(15,107,95,.1); }
.rank-number { align-items: center; background: #f0f6f4; border-radius: 8px; display: inline-flex; font-weight: 900; height: 40px; justify-content: center; width: 40px; }
.rank-score { color: var(--green-strong); font-size: 18px; font-weight: 900; white-space: nowrap; }
.ranking-filter { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(160px, 1fr)); }
.ranking-filter .primary-button { min-height: 42px; }
.ranking-summary { margin-top: 4px; }
.compact-button { width: auto; }
.equal-columns { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.competition-list { display: grid; gap: 14px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.competition-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  padding: clamp(14px, 2.5vw, 20px);
}
.competition-card h2 { font-size: 22px; }
.competition-card-head { align-items: center; display: flex; flex-wrap: wrap; gap: 8px; justify-content: space-between; }
.competition-description { color: var(--muted); font-size: 14px; line-height: 1.7; }
.competition-meta { display: grid; gap: 8px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin: 0; }
.competition-meta div { border-left: 3px solid var(--line); min-width: 0; padding-left: 9px; }
.competition-meta dt { color: var(--muted); font-size: 11px; font-weight: 800; }
.competition-meta dd { font-size: 13px; font-weight: 800; line-height: 1.45; margin: 3px 0 0; overflow-wrap: anywhere; }
.competition-meta-detail { margin: 4px 0; }
.competition-copy { border-top: 1px solid var(--line); display: grid; gap: 7px; padding-top: 14px; }
.competition-copy h2 { font-size: 19px; }
.competition-copy p { color: var(--muted); font-size: 14px; line-height: 1.75; }
.invitation-actions { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.invitation-actions form { margin: 0; }
.invitation-actions button { width: 100%; }
.entry-mark { color: var(--green-strong); font-size: 12px; font-weight: 900; }
.competition-phase.phase-active { background: #e6f5ed; color: #115b42; }
.competition-phase.phase-upcoming { background: #e9f2fa; color: #225d87; }
.competition-phase.phase-ended, .competition-phase.phase-closed { background: #f0f1f1; color: #56625f; }
.competition-fish-fieldset { border: 1px solid var(--line); margin: 0; min-width: 0; padding: 12px; }
.competition-fish-fieldset legend { color: var(--muted); font-size: 13px; font-weight: 800; padding: 0 5px; }
.competition-fish-options { display: grid; gap: 7px; grid-template-columns: repeat(3, minmax(0, 1fr)); margin-top: 10px; max-height: 340px; overflow-y: auto; padding: 2px; }
.competition-fish-option { align-items: center; background: #f7faf9; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: flex; gap: 9px; padding: 8px; }
.competition-fish-option input { accent-color: var(--green); min-height: auto; width: auto; }
.competition-fish-option span { display: grid; min-width: 0; }
.competition-fish-option strong, .competition-fish-option small { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.competition-fish-option small { color: var(--muted); font-size: 10px; }
.review-requirements { display: flex; flex-wrap: wrap; gap: 12px 22px; }
.review-list { display: grid; gap: 12px; }
.review-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(180px, 260px) minmax(0, 1fr);
  padding: 12px;
}
.review-photo { aspect-ratio: 4 / 3; background: var(--surface-strong); border-radius: 8px; height: 100%; max-height: 260px; object-fit: contain; width: 100%; }
.review-content { display: grid; gap: 9px; min-width: 0; }
.review-form { border-top: 1px solid var(--line); display: grid; gap: 9px; padding-top: 10px; }
.review-flags { display: flex; flex-wrap: wrap; gap: 6px; min-height: 22px; }
.review-flag { background: #eef5f1; border-radius: 4px; color: var(--green-strong); font-size: 11px; font-weight: 900; padding: 4px 6px; }
.review-flag.is-warning { background: #fff0ec; color: #a13a2b; }
.review-status.status-approved { background: #e6f5ed; color: #115b42; }
.review-status.status-rejected { background: #fff0ec; color: #a13a2b; }
.review-status.status-pending { background: #fff6df; color: #76521c; }
.review-filters .primary-button, .review-filters .secondary-button { min-width: 74px; }
.review-summary { align-items: center; display: flex; flex-wrap: wrap; gap: 8px 14px; margin: 0; }
.review-summary span { font-size: 12px; }
.table-actions { flex-wrap: nowrap; }
.fish-card { border: 1px solid var(--line); color: var(--ink); text-align: left; }
.fish-art { align-items: center; background: linear-gradient(135deg,#f4f8f7,#e7f0ed); border-radius: 8px; display: flex; height: 56px; justify-content: center; overflow: hidden; }
.fish-icon { display: block; filter: drop-shadow(0 4px 5px rgba(21,35,31,.14)); height: 54px; width: 100%; }
.fish-name { font-weight: 900; }
.fish-meta { color: var(--muted); font-size: 12px; line-height: 1.35; }
.empty-state { background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 20px; text-align: center; }
.map-filter { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(180px, 1fr) minmax(220px, 1.4fr) minmax(130px, .5fr); }
.catch-map-layout { display: grid; gap: 16px; grid-template-columns: minmax(0, 1.8fr) minmax(280px, .7fr); margin-top: 16px; }
.catch-map-tool, .map-results { min-width: 0; }
.catch-map {
  background: #d9e7eb;
  border: 1px solid var(--line);
  border-radius: 8px;
  cursor: grab;
  height: min(64vh, 680px);
  min-height: 440px;
  overflow: hidden;
  position: relative;
  touch-action: none;
  user-select: none;
  width: 100%;
}
.catch-map:focus-visible { outline: 3px solid rgba(47,111,159,.45); outline-offset: 2px; }
.catch-map.is-dragging { cursor: grabbing; }
.catch-map-tiles, .catch-map-markers { inset: 0; position: absolute; }
.catch-map-tile { height: 256px; max-width: none; pointer-events: none; position: absolute; width: 256px; }
.catch-map-marker {
  align-items: center;
  background: var(--green);
  border: 3px solid #fff;
  border-radius: 50%;
  box-shadow: 0 3px 10px rgba(21,35,31,.28);
  color: #fff;
  display: flex;
  font-size: 13px;
  font-weight: 900;
  height: 38px;
  justify-content: center;
  min-height: 38px;
  padding: 0;
  position: absolute;
  transform: translate(-50%, -50%);
  width: 38px;
  z-index: 4;
}
.catch-map-marker:hover, .catch-map-marker:focus-visible { background: var(--green-strong); outline: 3px solid rgba(255,255,255,.8); }
.catch-map-popup {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  display: grid;
  font-size: 12px;
  gap: 4px;
  max-width: min(260px, calc(100vw - 48px));
  padding: 10px;
  pointer-events: auto;
  position: absolute;
  transform: translate(-50%, calc(-100% - 25px));
  width: max-content;
  z-index: 6;
}
.catch-map-popup span { color: var(--muted); line-height: 1.4; }
.catch-map-controls { display: grid; gap: 4px; left: 10px; position: absolute; top: 10px; z-index: 8; }
.catch-map-controls button {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 2px 8px rgba(21,35,31,.16);
  color: var(--ink);
  display: flex;
  font-size: 24px;
  font-weight: 700;
  height: 42px;
  justify-content: center;
  line-height: 1;
  padding: 0;
  width: 42px;
}
.map-attribution { background: rgba(255,255,255,.92); bottom: 0; color: #334c57; font-size: 10px; padding: 4px 6px; position: absolute; right: 0; text-decoration: underline; z-index: 8; }
.map-results { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; padding: 14px; }
.map-results h2 { font-size: 22px; }
.map-status { color: var(--muted); font-size: 13px; line-height: 1.5; margin-bottom: 10px; }
.map-status.is-error { color: #a13a2b; font-weight: 800; }
.map-result-list { display: grid; gap: 8px; max-height: 570px; overflow-y: auto; padding-right: 3px; }
.map-result-row { background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: grid; gap: 6px; padding: 10px; text-align: left; width: 100%; }
.map-result-row:hover, .map-result-row:focus-visible { border-color: var(--green); outline: 2px solid rgba(15,107,95,.14); }
.map-result-heading { align-items: center; display: flex; gap: 8px; justify-content: space-between; }
.map-result-species { font-size: 13px; font-weight: 800; line-height: 1.45; }
.map-result-date { color: var(--muted); font-size: 12px; }
.bottom-nav {
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  bottom: 0;
  display: grid;
  grid-template-columns: repeat(7, minmax(0,1fr));
  left: 0;
  padding: 8px 8px calc(8px + env(safe-area-inset-bottom));
  position: fixed;
  right: 0;
  z-index: 30;
}
.bottom-nav a { color: var(--muted); font-size: 12px; font-weight: 900; min-height: 44px; padding: 8px 2px; text-align: center; }
.muted { color: var(--muted); }
.table-wrap { overflow-x: auto; }
table { border-collapse: collapse; width: 100%; }
th, td { border-bottom: 1px solid var(--line); padding: 10px; text-align: left; white-space: nowrap; }
th { color: var(--muted); font-size: 12px; }
.admin-nav-grid { display: grid; gap: 12px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.admin-nav-card { background: #fff; border: 1px solid var(--line); border-radius: 8px; color: var(--ink); display: grid; gap: 7px; min-height: 112px; padding: 15px; }
.admin-nav-card:hover, .admin-nav-card:focus-visible { border-color: var(--green); outline: 2px solid rgba(15,107,95,.12); }
.admin-nav-card strong { font-size: 17px; }
.admin-nav-card span { color: var(--muted); font-size: 13px; line-height: 1.55; }
.admin-search { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(220px, 1fr) auto; }
.admin-form-panel { margin-top: 16px; }
.table-subtext { color: var(--muted); font-size: 12px; }
.status-suspended { background: #f1f2f2; color: #596662; }
.tier-summary-cell { line-height: 1.55; max-width: 520px; white-space: normal; }
.scoring-tier-fieldset { border: 1px solid var(--line); margin: 0; min-width: 0; padding: 14px; }
.scoring-tier-fieldset legend { color: var(--ink); font-size: 15px; font-weight: 900; padding: 0 6px; }
.scoring-tier-list { display: grid; gap: 10px; margin: 12px 0; }
.scoring-tier-row { align-items: end; display: grid; gap: 10px; grid-template-columns: minmax(150px, 1fr) minmax(130px, .7fr) auto; }
.scoring-tier-remove { min-height: 42px; }
.recalculate-option { margin-top: 4px; }
.formula-display { background: #f2f7f5; border-left: 4px solid var(--green); padding: 14px; }
.formula-display strong { font-size: 14px; line-height: 1.7; }
.category-rule-grid { display: grid; gap: 10px; grid-template-columns: repeat(2, minmax(0, 1fr)); }
.category-rule-row { align-items: center; border-bottom: 1px solid var(--line); display: grid; gap: 12px; grid-template-columns: minmax(0, 1fr) 120px; padding: 8px 0; }
.category-rule-row > span:first-child { font-size: 13px; font-weight: 800; }
.category-rule-row.has-actions { grid-template-columns: minmax(180px, 1fr) 150px auto; }
.category-rule-row.has-actions label { font-size: 11px; }
.category-rule-remove { min-height: 42px; }
.points-input { align-items: center; display: grid; gap: 7px; grid-template-columns: minmax(0, 1fr) auto; }
.points-input b { color: var(--muted); font-size: 12px; }
.scoring-mode-control label { cursor: pointer; margin: 0; position: relative; }
.scoring-mode-control label input { height: 1px; opacity: 0; position: absolute; width: 1px; }
.scoring-mode-control label span { align-items: center; border-radius: 6px; color: var(--muted); display: flex; font-size: 13px; font-weight: 900; justify-content: center; min-height: 42px; padding: 7px 10px; text-align: center; }
.scoring-mode-control label input:checked + span { background: #fff; box-shadow: 0 1px 4px rgba(21,35,31,.12); color: var(--green-strong); }
.scoring-mode-control label input:focus-visible + span { outline: 3px solid rgba(47,111,159,.35); }
.support-ticket-list { display: grid; gap: 8px; }
.support-ticket-row {
  align-items: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  display: grid;
  gap: 12px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 13px;
}
.support-ticket-row:hover, .support-ticket-row:focus-visible { border-color: var(--green); outline: 2px solid rgba(15,107,95,.12); }
.support-ticket-row.is-unread { border-left: 4px solid #2f6f9f; }
.support-ticket-row > div:first-child { display: grid; gap: 5px; min-width: 0; }
.support-ticket-row strong { overflow-wrap: anywhere; }
.support-ticket-meta { color: var(--muted); font-size: 12px; line-height: 1.45; }
.support-ticket-state { align-items: flex-end; display: grid; gap: 7px; justify-items: end; }
.support-unread-tag { background: #e8f3fa; color: #205d84; }
.support-ticket-summary { display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.support-ticket-summary > div { background: var(--surface); border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 4px; padding: 12px; }
.support-ticket-summary span, .support-ticket-summary small { color: var(--muted); font-size: 12px; overflow-wrap: anywhere; }
.support-ticket-summary strong { overflow-wrap: anywhere; }
.support-conversation { display: grid; gap: 10px; margin: 16px auto; max-width: 1120px; width: calc(100% - 32px); }
.support-message { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 9px; max-width: 82%; padding: 14px; }
.support-message.is-user { background: #fff; justify-self: start; }
.support-message.is-staff { background: #edf6f8; border-color: #bad3dc; justify-self: end; }
.support-message-head { align-items: center; display: flex; gap: 12px; justify-content: space-between; }
.support-message-head time { color: var(--muted); font-size: 11px; white-space: nowrap; }
.support-message p { line-height: 1.7; margin: 0; overflow-wrap: anywhere; white-space: normal; }
.support-filter { align-items: end; display: grid; gap: 10px; grid-template-columns: repeat(3, minmax(120px, .7fr)) minmax(180px, 1.2fr) auto; }
.support-filter .primary-button { min-height: 42px; width: auto; }
.support-admin-unread { background: #eef7fb; }
.support-admin-table td:nth-child(2) { max-width: 420px; white-space: normal; }
.support-priority { border-radius: 999px; display: inline-flex; font-size: 12px; font-weight: 900; padding: 5px 8px; }
.priority-low { background: #eef1f0; color: #50605b; }
.priority-normal { background: #e7f3ee; color: #17604f; }
.priority-high { background: #fff3d8; color: #7b5712; }
.priority-urgent { background: #fde9e5; color: #9e3328; }
.review-status.status-open { background: #fde9e5; color: #963a2f; }
.review-status.status-in_progress { background: #e8f3fa; color: #205d84; }
.review-status.status-waiting_user { background: #fff3d8; color: #7b5712; }
.review-status.status-resolved { background: #e6f5ed; color: #115b42; }
.review-status.status-closed { background: #eef1f0; color: #50605b; }
.ad-admin-list { display: grid; gap: 16px; }
.ad-admin-row { border: 1px solid var(--line); border-radius: 8px; display: grid; gap: 14px; padding: 16px; }
.ad-admin-row h3 { font-size: 20px; margin: 6px 0 0; }
.ad-admin-preview {
  align-items: center;
  aspect-ratio: 16 / 5;
  background: #edf3f1;
  border: 1px solid var(--line);
  display: flex;
  justify-content: center;
  max-height: 280px;
  overflow: hidden;
}
.ad-admin-preview img { display: block; height: 100%; object-fit: contain; width: 100%; }
.moderation-report-page { margin: 0 auto; max-width: 820px; }
.moderation-report-target { box-shadow: none; }
.moderation-owner-notice { font-size: 13px; line-height: 1.6; margin: 10px 0 0; }
.moderation-filters { display: grid; gap: 8px; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.moderation-filters a { width: 100%; }
.moderation-list { display: grid; gap: 14px; }
.moderation-card { display: grid; gap: 16px; }
.moderation-catch-summary { display: grid; gap: 16px; grid-template-columns: minmax(190px, 260px) minmax(0, 1fr); }
.moderation-report-details { border-bottom: 1px solid var(--line); border-top: 1px solid var(--line); padding: 12px 0; }
.moderation-report-details > summary { color: var(--green-strong); cursor: pointer; font-size: 14px; font-weight: 900; }
.moderation-report-list { display: grid; margin-top: 10px; }
.moderation-report-row { border-top: 1px solid var(--line); display: grid; gap: 7px; padding: 12px 0; }
.moderation-report-row:first-child { border-top: 0; }
.moderation-report-row p:not(.catch-meta):not(.field-help) { font-size: 13px; line-height: 1.7; overflow-wrap: anywhere; }
.moderation-decision-form { display: grid; gap: 10px; }
.moderation-status.status-visible { background: #e6f5ed; color: #115b42; }
.moderation-status.status-under_review { background: #fff3d8; color: #7b5712; }
.moderation-status.status-hidden { background: #fde9e5; color: #963a2f; }
.moderation-review-button { border-color: #d4aa50; color: #76521c; }
.brand-preview {
  align-items: center;
  background: #fff;
  border-bottom: 4px solid var(--brand-preview-color);
  border-top: 1px solid var(--line);
  display: flex;
  gap: 14px;
  margin: 16px 0;
  padding: 18px clamp(14px, 3vw, 24px);
}
.brand-preview-mark {
  align-items: center;
  background: var(--brand-preview-color);
  border-radius: 8px;
  color: #fff;
  display: inline-flex;
  flex: 0 0 52px;
  font-size: 18px;
  font-weight: 900;
  height: 52px;
  justify-content: center;
  overflow: hidden;
  width: 52px;
}
.brand-preview-logo { background: #fff; border: 1px solid var(--line); padding: 4px; }
.brand-preview-logo img { display: block; height: 100%; object-fit: contain; width: 100%; }
.brand-preview > span:last-child { display: grid; gap: 3px; min-width: 0; }
.brand-preview small { color: var(--muted); font-size: 12px; font-weight: 800; overflow-wrap: anywhere; }
.brand-preview strong { font-size: 24px; line-height: 1.2; overflow-wrap: anywhere; }
.brand-color-control { align-items: center; display: grid; gap: 10px; grid-template-columns: 64px minmax(0, 1fr); }
.brand-color-control input[type="color"] { cursor: pointer; height: 42px; padding: 3px; }
.brand-color-control code { color: var(--muted); font-size: 13px; }
.section-divider { border: 0; border-top: 1px solid var(--line); margin: 8px 0; width: 100%; }
.readiness-list { border-top: 1px solid var(--line); display: grid; }
.readiness-row {
  align-items: center;
  border-bottom: 1px solid var(--line);
  display: grid;
  gap: 14px;
  grid-template-columns: minmax(0, 1fr) auto;
  padding: 14px 0 14px 13px;
}
.readiness-row > div { display: grid; gap: 6px; min-width: 0; }
.readiness-row p { color: var(--muted); font-size: 13px; line-height: 1.6; overflow-wrap: anywhere; }
.readiness-row.status-pass { border-left: 4px solid #23845f; }
.readiness-row.status-warning { border-left: 4px solid #d39a2d; }
.readiness-row.status-fail { border-left: 4px solid #c84e3b; }
.readiness-title { align-items: center; display: flex; gap: 10px; justify-content: space-between; }
.readiness-title strong { font-size: 15px; }
.readiness-status { border-radius: 999px; flex: 0 0 auto; font-size: 12px; font-weight: 900; padding: 5px 8px; }
.status-pass .readiness-status { background: #e6f5ed; color: #115b42; }
.status-warning .readiness-status { background: #fff3d8; color: #76521c; }
.status-fail .readiness-status { background: #fde9e5; color: #963a2f; }
.readiness-manual-list { border-top: 1px solid var(--line); display: grid; }
.readiness-manual-row { border: 0; border-bottom: 1px solid var(--line); display: grid; gap: 10px; margin: 0; padding: 16px 0; }
.readiness-check-label { align-items: flex-start; color: var(--ink); }
.readiness-check-label input { margin-top: 3px; }
.readiness-check-label span { display: grid; gap: 5px; }
.readiness-check-label strong { font-size: 15px; line-height: 1.45; }
.readiness-check-label small { color: var(--muted); font-size: 12px; font-weight: 500; line-height: 1.55; }
.secret-once-panel { border-color: #b26b00; }
.secret-once-value {
  font-family: Consolas, "Courier New", monospace;
  font-size: 0.88rem;
  overflow-wrap: anywhere;
}

@media (max-width: 860px) {
  .grid-2, .grid-3, .analysis-layout, .competition-list { grid-template-columns: 1fr; }
  .competition-fish-options { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .review-card { grid-template-columns: minmax(140px, 210px) minmax(0, 1fr); }
  .ranking-filter { grid-template-columns: 1fr; }
  .map-filter, .catch-map-layout { grid-template-columns: 1fr; }
  .map-results { padding: 12px; }
  .map-result-list { max-height: none; }
  .topnav { display: none; }
  .mobile-notification-link {
    align-items: center;
    background: var(--surface-strong);
    border: 1px solid var(--line);
    border-radius: 8px;
    display: inline-flex;
    flex: 0 0 auto;
    font-size: 13px;
    font-weight: 900;
    min-height: 40px;
    padding: 7px 9px;
  }
  .section-head { align-items: flex-start; flex-direction: column; }
  .admin-nav-grid { grid-template-columns: 1fr; }
  .support-filter { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .support-filter .primary-button { width: 100%; }
  .moderation-catch-summary { grid-template-columns: minmax(150px, 210px) minmax(0, 1fr); }
}

@media (max-width: 520px) {
  .install-app-panel { margin-top: 36px; }
  .catch-map { height: 54vh; min-height: 360px; }
  .bottom-nav a { font-size: 11px; }
  .competition-meta, .competition-fish-options, .invitation-actions { grid-template-columns: 1fr; }
  .review-card { grid-template-columns: 1fr; }
  .review-photo { height: auto; max-height: none; }
  .review-filters { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .catch-card, .feed-card { grid-template-columns: 94px minmax(0, 1fr); }
  .fish-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .result-strip { grid-template-columns: 1fr; }
  .rank-row { grid-template-columns: 46px minmax(0, 1fr); }
  .rank-score { grid-column: 2; }
  .friend-row { align-items: stretch; flex-direction: column; }
  .friend-actions { justify-content: flex-start; }
  .friend-search { align-items: stretch; grid-template-columns: 1fr; }
  .friend-search .primary-button { width: 100%; }
  .notification-item, .announcement-admin-row { align-items: stretch; flex-direction: column; }
  .notification-actions .primary-button, .notification-actions .secondary-button { width: 100%; }
  .admin-search, .scoring-tier-row, .audit-filter { grid-template-columns: 1fr; }
  .audit-filter-query { grid-column: auto; }
  .scoring-tier-remove { width: 100%; }
  .category-rule-grid { grid-template-columns: 1fr; }
  .category-rule-row.has-actions { grid-template-columns: 1fr; }
  .category-rule-remove { width: 100%; }
  .support-ticket-row, .support-ticket-summary, .support-filter { grid-template-columns: 1fr; }
  .support-ticket-state { align-items: start; justify-items: start; }
  .support-message { max-width: 94%; }
  .moderation-filters { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .moderation-catch-summary { grid-template-columns: 1fr; }
  .moderation-catch-summary .review-photo { height: auto; max-height: none; }
  .moderation-decision-form .inline-controls { display: grid; grid-template-columns: 1fr; }
  .moderation-decision-form button { width: 100%; }
  .readiness-row { align-items: stretch; grid-template-columns: 1fr; }
  .readiness-row .secondary-button { width: 100%; }
}
