/* ============================================================
   GATOR PERMIT TRACKER — styles.css
   ============================================================ */
:root {
  --green-900: #173404;
  --green-800: #27500A;
  --green-700: #3B6D11;
  --green-600: #639922;
  --green-400: #97C459;
  --green-200: #C0DD97;
  --green-100: #EAF3DE;
  --amber-700: #854F0B;
  --amber-600: #BA7517;
  --amber-100: #FAEEDA;
  --amber-50:  #FAF3E0;
  --red-700:   #A32D2D;
  --red-600:   #E24B4A;
  --red-100:   #FCEBEB;
  --coral-600: #993C1D;
  --coral-100: #FAECE7;
  --gray-900:  #2C2C2A;
  --gray-700:  #5F5E5A;
  --gray-400:  #888780;
  --gray-200:  #D3D1C7;
  --gray-100:  #F1EFE8;
  --white:     #ffffff;
  --bg:        #f4f7f0;
  --surface:   #ffffff;
  --border:    rgba(0,0,0,0.10);
  --border-md: rgba(0,0,0,0.18);
  --shadow-sm: 0 1px 3px rgba(0,0,0,0.08);
  --shadow-md: 0 4px 12px rgba(0,0,0,0.10);
  --radius-sm: 8px;
  --radius-md: 12px;
  --radius-lg: 16px;
  --font: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --safe-bottom: env(safe-area-inset-bottom, 0px);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; width: 100%; }
body {
  font-family: var(--font);
  background: var(--bg);
  color: var(--gray-900);
  height: 100%;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}

#app { display: flex; flex-direction: column; height: 100%; max-width: 480px; margin: 0 auto; }
.app {
  display: flex;
  flex-direction: column;
  height: 100dvh;
  height: 100vh;
  overflow: hidden;
}

@media (min-width: 480px) {
  #app, .app { max-width: 100%; }
}

/* ---- AUTH ---- */
#authScreen {
  display: flex; flex-direction: column;
  justify-content: center; align-items: center;
  min-height: 100vh; padding: 24px; background: var(--bg);
}
.auth-logo  { font-size: 56px; margin-bottom: 8px; }
.auth-title { font-size: 22px; font-weight: 700; color: var(--green-700); margin-bottom: 4px; }
.auth-sub   { font-size: 14px; color: var(--gray-700); margin-bottom: 32px; text-align: center; }
.auth-card  { width: 100%; background: var(--surface); border-radius: var(--radius-lg); padding: 24px; box-shadow: var(--shadow-md); }
.auth-tabs  { display: flex; margin-bottom: 20px; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--border); }
.auth-tab   { flex: 1; padding: 10px; border: none; background: none; font-size: 14px; font-weight: 500; color: var(--gray-700); cursor: pointer; }
.auth-tab.active { background: var(--green-700); color: white; }
.auth-error { color: var(--red-700); font-size: 13px; margin-top: 10px; text-align: center; display: none; }

/* ---- FORM ELEMENTS ---- */
.field { display: flex; flex-direction: column; gap: 5px; margin-bottom: 14px; }
.field label { font-size: 12px; font-weight: 600; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.04em; }
.field input, .field select, .field textarea {
  padding: 11px 13px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-md); background: var(--bg);
  font-size: 15px; color: var(--gray-900); font-family: var(--font);
  transition: border-color 0.15s, box-shadow 0.15s; width: 100%;
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(99,153,34,0.15);
}
.field textarea { resize: vertical; min-height: 60px; }
.field-row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

/* ---- BUTTONS ---- */
.btn {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600; cursor: pointer; border: none;
  transition: opacity 0.15s, transform 0.1s; width: 100%; font-family: var(--font);
}
.btn:active { transform: scale(0.98); }
.btn-primary   { background: var(--green-700); color: white; }
.btn-primary:hover { background: var(--green-800); }
.btn-secondary { background: var(--green-100); color: var(--green-700); }
.btn-danger    { background: var(--red-100); color: var(--red-700); }
.btn-outline   { background: none; border: 1px solid var(--border-md); color: var(--gray-700); }
.btn-map       { background: var(--coral-100); color: var(--coral-600); border: 1px solid rgba(153,60,29,0.2); }
.btn-sm        { padding: 8px 14px; font-size: 13px; width: auto; }
.btn:disabled  { opacity: 0.5; cursor: not-allowed; }

/* ---- TOP BAR ---- */
.top-bar {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 12px 16px; display: flex; align-items: center; justify-content: space-between;
  flex-shrink: 0; padding-top: calc(12px + env(safe-area-inset-top, 0px));
}
.top-bar-left  { display: flex; align-items: center; gap: 10px; }
.top-bar-logo  { font-size: 22px; }
.top-bar-title { font-size: 16px; font-weight: 700; color: var(--green-700); line-height: 1.1; }
.top-bar-sub   { font-size: 11px; color: var(--gray-700); }
.top-bar-right { display: flex; align-items: center; gap: 8px; }
.avatar {
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--green-100); color: var(--green-700);
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; cursor: pointer; border: 2px solid var(--green-200);
}

/* ---- TOP NAV (pinned to top) ---- */
.top-nav {
  display: flex;
  background: var(--green-700);
  flex-shrink: 0;
  padding-top: env(safe-area-inset-top, 0px);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: 0 2px 8px rgba(0,0,0,0.15);
}
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center;
  padding: 8px 2px 6px; border: none; background: none;
  font-size: 9px; font-weight: 600; color: rgba(255,255,255,0.65);
  cursor: pointer; gap: 2px; text-transform: uppercase; letter-spacing: 0.03em;
  transition: color 0.15s, background 0.15s; font-family: var(--font);
}
.nav-item .nav-icon  { font-size: 20px; }
.nav-item .nav-label { font-size: 9px; }
.nav-item.active     { color: white; background: rgba(255,255,255,0.15); border-radius: 8px; }

/* ---- USER BAR ---- */
.user-bar {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
  padding: 8px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-shrink: 0;
}
.user-bar-title { font-size: 14px; font-weight: 600; color: var(--green-700); }

/* ---- SEARCH BAR ---- */
.search-bar { margin-bottom: 10px; }
.search-bar input {
  width: 100%; padding: 11px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--border-md);
  background: var(--surface);
  font-size: 15px; color: var(--gray-900);
  font-family: var(--font);
  box-shadow: var(--shadow-sm);
}
.search-bar input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(99,153,34,0.15); }

/* ---- FILTER CHIPS ---- */
.filter-chips { display: flex; gap: 6px; margin-bottom: 12px; flex-wrap: wrap; }
.chip {
  padding: 5px 14px; border-radius: 20px; border: 1px solid var(--border-md);
  background: var(--surface); color: var(--gray-700);
  font-size: 12px; font-weight: 600; cursor: pointer;
  font-family: var(--font); transition: all 0.15s;
}
.chip.active { background: var(--green-700); color: white; border-color: var(--green-700); }

/* ---- NOTIFICATIONS ---- */
#notifBell:hover { opacity: 0.8; }
#notifBell { transition: opacity 0.15s; }

/* ---- THA TOGGLE ---- */
.tha-toggle-card {
  background: var(--surface);
  border: 2px solid var(--border-md);
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 14px;
  cursor: pointer;
  transition: all 0.2s;
  color: var(--gray-700);
}
.tha-toggle-card:hover { border-color: var(--green-400); }
.tha-toggle-active {
  background: linear-gradient(135deg, #1d2e10, #27500A);
  border-color: var(--green-400) !important;
  color: white;
}

.tha-toggle-switch {
  position: relative; display: inline-block;
  width: 44px; height: 24px; flex-shrink: 0;
}
.tha-toggle-switch input { opacity: 0; width: 0; height: 0; }
.tha-slider {
  position: absolute; cursor: pointer; inset: 0;
  background: rgba(255,255,255,0.2); border-radius: 24px;
  transition: 0.2s;
}
.tha-slider:before {
  content: ''; position: absolute;
  width: 18px; height: 18px; left: 3px; bottom: 3px;
  background: white; border-radius: 50%; transition: 0.2s;
}
.tha-toggle-switch input:checked + .tha-slider { background: var(--green-400); }
.tha-toggle-switch input:checked + .tha-slider:before { transform: translateX(20px); }
.tha-toggle-card:not(.tha-toggle-active) .tha-slider { background: var(--gray-200); }

/* ---- LEADERBOARD ---- */
.lb-card {
  border-radius: var(--radius-md);
  padding: 14px;
  margin-bottom: 10px;
  display: flex;
  align-items: flex-start;
  gap: 12px;
  box-shadow: var(--shadow-md);
}
.lb-first  { background: linear-gradient(135deg, #2C2200, #4A3800); border: 1px solid #F0C040; }
.lb-second { background: linear-gradient(135deg, #1A1E22, #2C3440); border: 1px solid #8899AA; }
.lb-third  { background: linear-gradient(135deg, #2A1800, #3D2510); border: 1px solid #C07040; }
.lb-card:not(.lb-first):not(.lb-second):not(.lb-third) {
  background: linear-gradient(135deg, #1a1e17, #242820);
  border: 1px solid rgba(255,255,255,0.12);
}

.lb-rank   { font-size: 24px; flex-shrink: 0; line-height: 1; margin-top: 2px; }
.lb-avatar {
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
.lb-first  .lb-avatar { background: rgba(240,192,64,0.2);  color: #F0C040; border: 2px solid #F0C040; }
.lb-second .lb-avatar { background: rgba(136,153,170,0.2); color: #AAB8C8; border: 2px solid #8899AA; }
.lb-third  .lb-avatar { background: rgba(192,112,64,0.2);  color: #E09060; border: 2px solid #C07040; }
.lb-card:not(.lb-first):not(.lb-second):not(.lb-third) .lb-avatar {
  background: rgba(99,153,34,0.2); color: #97C459; border: 2px solid #639922;
}

.lb-info   { flex: 1; min-width: 0; }
.lb-name   { font-size: 15px; font-weight: 700; color: #ffffff; margin-bottom: 6px; }
.lb-stats  { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 6px; }
.lb-stat   { font-size: 12px; color: rgba(255,255,255,0.8); display: flex; align-items: center; gap: 3px; font-weight: 600; }
.lb-stat-icon { font-size: 13px; }

.lb-sizes  { display: flex; flex-wrap: wrap; gap: 6px; }
.lb-size-badge {
  font-size: 11px; font-weight: 600; padding: 2px 8px;
  border-radius: 20px;
  background: rgba(99,153,34,0.25);
  color: #97C459;
  border: 1px solid rgba(99,153,34,0.4);
}
.lb-size-largest {
  background: rgba(186,117,23,0.25);
  color: #FAC775;
  border-color: rgba(186,117,23,0.4);
}

/* ---- GATE CODES ---- */
.gate-card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 13px 14px;
  margin-bottom: 8px; box-shadow: var(--shadow-sm);
}
.gate-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.gate-community  { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.gate-code-badge {
  font-size: 15px; font-weight: 700; color: var(--green-700);
  background: var(--green-100); padding: 3px 12px;
  border-radius: 20px; border: 1px solid var(--green-200);
  letter-spacing: 0.05em;
}
.gate-meta { font-size: 12px; color: var(--gray-700); margin-top: 4px; line-height: 1.5; }
.gate-actions { display: flex; gap: 6px; margin-top: 8px; }

/* ---- CONTENT AREA — defined later ---- */

/* ---- CARDS ---- */
.card {
  background: var(--surface); border-radius: var(--radius-md);
  border: 1px solid var(--border); padding: 14px;
  margin-bottom: 10px; box-shadow: var(--shadow-sm);
}
.card-title {
  font-size: 11px; font-weight: 700; color: var(--gray-700);
  text-transform: uppercase; letter-spacing: 0.06em;
  margin-bottom: 12px; display: flex; align-items: center; gap: 6px;
}
.card-title-icon { font-size: 15px; }

/* ---- STATS ---- */
.stats-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 12px; }
.stat-card  { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 12px 14px; text-align: center; }
.stat-val   { font-size: 30px; font-weight: 700; line-height: 1; }
.stat-label { font-size: 11px; color: var(--gray-700); margin-top: 3px; }

/* ---- PERMIT CARDS ---- */
.permit-card {
  background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border);
  padding: 13px 14px; margin-bottom: 8px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
  touch-action: manipulation; /* Android: prevents 300ms tap delay and scroll conflicts */
}
.permit-card:hover { border-color: var(--green-400); box-shadow: var(--shadow-md); }
.permit-card-header { display: flex; align-items: flex-start; justify-content: space-between; margin-bottom: 6px; }
.permit-num  { font-size: 14px; font-weight: 700; color: var(--gray-900); }
.permit-date { font-size: 11px; color: var(--gray-700); margin-top: 1px; }
.permit-meta { font-size: 13px; color: var(--gray-700); line-height: 1.5; }
.permit-meta strong { color: var(--gray-900); }
.permit-trapper   { display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--green-700); background: var(--green-100); padding: 2px 8px; border-radius: 20px; margin-top: 6px; }
.permit-unassigned{ display: inline-flex; align-items: center; gap: 4px; font-size: 11px; font-weight: 600; color: var(--amber-600); background: var(--amber-100); padding: 2px 8px; border-radius: 20px; margin-top: 6px; }

/* ---- BADGES ---- */
.badge { display: inline-flex; align-items: center; font-size: 11px; font-weight: 600; padding: 3px 9px; border-radius: 20px; white-space: nowrap; }
.badge-active   { background: var(--green-100); color: var(--green-700); }
.badge-expired  { background: var(--red-100); color: var(--red-700); }
.badge-closed   { background: var(--gray-100); color: var(--gray-700); }
.badge-pending  { background: var(--amber-100); color: var(--amber-600); }
.badge-harvested{ background: var(--amber-50); color: var(--amber-700); border: 1px solid rgba(186,117,23,0.25); }
.badge-released { background: var(--green-100); color: var(--green-700); }
.badge-admin    { background: var(--coral-100); color: var(--coral-600); font-size: 10px; }

/* ---- GATOR CHIPS ---- */
.gator-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.gator-chip  { font-size: 11px; padding: 3px 9px; border-radius: 20px; border: 1px solid var(--border); cursor: pointer; }

/* ---- DETAIL OVERLAY ---- */
.detail-overlay {
  display: none;
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  width: 100%;
  height: 100%;
  background: var(--bg);
  z-index: 40;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
  padding-bottom: 20px;
}
.detail-overlay.active { display: block; }
.detail-header {
  background: var(--surface); border-bottom: 1px solid var(--border);
  padding: 10px 16px;
  display: flex; align-items: center; gap: 12px;
  position: sticky; top: 0; z-index: 10;
}
.back-btn { border: none; background: none; color: var(--green-700); font-size: 22px; cursor: pointer; padding: 4px; flex-shrink: 0; }
.detail-header-info { flex: 1; min-width: 0; }
.detail-title { font-size: 16px; font-weight: 700; color: var(--gray-900); }
.detail-body  { padding: 14px; }

.detail-row { display: flex; justify-content: space-between; align-items: flex-start; padding: 7px 0; border-bottom: 1px solid var(--border); font-size: 13px; }
.detail-row:last-child { border-bottom: none; padding-bottom: 0; }
.detail-row .dr-label { color: var(--gray-700); flex-shrink: 0; margin-right: 10px; }
.detail-row .dr-val   { color: var(--gray-900); font-weight: 500; text-align: right; max-width: 60%; }

/* ---- GATOR DETAIL ---- */
.gator-detail { background: var(--green-100); border-radius: var(--radius-sm); border: 1px solid var(--green-200); padding: 12px; margin-bottom: 10px; }
.gator-detail-title { font-size: 13px; font-weight: 700; color: var(--green-700); margin-bottom: 10px; }
.disp-select { width: 100%; padding: 9px 11px; border-radius: var(--radius-sm); border: 1px solid var(--green-400); background: white; font-size: 14px; color: var(--gray-900); margin-top: 4px; font-family: var(--font); }

/* ---- UPLOAD ZONE ---- */
.upload-zone {
  border: 2px dashed var(--green-400); border-radius: var(--radius-md);
  padding: 32px 20px; text-align: center; cursor: pointer;
  background: var(--green-100); transition: background 0.15s; margin-bottom: 14px;
}
.upload-zone:hover { background: var(--green-200); }
.upload-zone-icon { font-size: 40px; margin-bottom: 8px; }
.upload-zone p     { font-size: 15px; font-weight: 600; color: var(--green-700); margin-bottom: 4px; }
.upload-zone small { font-size: 13px; color: var(--gray-700); }

/* ---- GATOR ENTRY (form) ---- */
.gator-entry { background: var(--green-100); border-radius: var(--radius-sm); border: 1px solid var(--green-200); padding: 12px; margin-bottom: 10px; }
.gator-entry-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.gator-entry-title  { font-size: 13px; font-weight: 700; color: var(--green-700); }
.remove-btn { background: none; border: none; color: var(--red-700); font-size: 18px; cursor: pointer; padding: 2px; }

/* ---- TRAPPERS ---- */
.trapper-card { background: var(--surface); border-radius: var(--radius-md); border: 1px solid var(--border); padding: 13px 14px; margin-bottom: 8px; display: flex; align-items: center; gap: 12px; }
.trapper-avatar { width: 42px; height: 42px; border-radius: 50%; flex-shrink: 0; background: var(--green-100); color: var(--green-700); display: flex; align-items: center; justify-content: center; font-size: 15px; font-weight: 700; border: 2px solid var(--green-200); }
.trapper-info { flex: 1; min-width: 0; }
.trapper-name { font-size: 14px; font-weight: 600; color: var(--gray-900); }
.trapper-meta { font-size: 12px; color: var(--gray-700); }

/* ---- FILTER BAR ---- */
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; }
.filter-bar input  { flex: 1; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-md); background: var(--surface); font-size: 14px; color: var(--gray-900); font-family: var(--font); }
.filter-bar select { padding: 10px 8px; border-radius: var(--radius-sm); border: 1px solid var(--border-md); background: var(--surface); font-size: 13px; color: var(--gray-900); font-family: var(--font); }

/* ---- PARSE LOADING ---- */
.parse-loading { display: none; background: var(--green-100); border-radius: var(--radius-md); padding: 20px; text-align: center; margin-bottom: 14px; }
.parse-loading.active { display: block; }
.parse-loading p { font-size: 13px; color: var(--green-700); margin-top: 10px; font-weight: 500; }

/* ---- SECTION DIVIDER ---- */
.section-divider { font-size: 11px; font-weight: 700; color: var(--gray-700); text-transform: uppercase; letter-spacing: 0.06em; margin: 18px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--border); }

/* ---- MODAL ---- */
.modal-backdrop { display: none; position: fixed; inset: 0; background: rgba(0,0,0,0.45); z-index: 150; align-items: flex-end; justify-content: center; }
.modal-backdrop.active { display: flex; }
.modal { background: var(--surface); border-radius: var(--radius-lg) var(--radius-lg) 0 0; width: 100%; max-width: 480px; padding: 20px; padding-bottom: calc(20px + var(--safe-bottom)); max-height: 80vh; overflow-y: auto; }
.modal-title   { font-size: 17px; font-weight: 700; margin-bottom: 16px; }
.modal-actions { display: flex; gap: 10px; margin-top: 16px; }
.modal-actions .btn { flex: 1; }

/* ---- TOAST ---- */
.toast { position: fixed; bottom: calc(70px + var(--safe-bottom)); left: 50%; transform: translateX(-50%) translateY(20px); background: var(--gray-900); color: white; padding: 10px 20px; border-radius: var(--radius-md); font-size: 14px; font-weight: 500; z-index: 200; opacity: 0; transition: opacity 0.2s, transform 0.2s; white-space: nowrap; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---- LOADING ---- */
.loading-overlay { position: fixed; inset: 0; background: rgba(255,255,255,0.85); display: flex; flex-direction: column; align-items: center; justify-content: center; z-index: 300; gap: 14px; }
.spinner { width: 36px; height: 36px; border: 3px solid var(--green-200); border-top-color: var(--green-700); border-radius: 50%; animation: spin 0.7s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.loading-overlay p { font-size: 14px; color: var(--green-700); font-weight: 500; }

/* ---- EMPTY STATE ---- */
.empty-state { text-align: center; padding: 48px 20px; color: var(--gray-700); }
.empty-state-icon { font-size: 48px; margin-bottom: 12px; }
.empty-state p { font-size: 15px; }

/* ---- MISC ---- */
.text-green { color: var(--green-700); }
.text-red   { color: var(--red-700); }
.text-amber { color: var(--amber-600); }
.text-muted { color: var(--gray-700); }
.mt-8  { margin-top: 8px; }
.mt-12 { margin-top: 12px; }
.tag   { background: var(--amber-100); color: var(--amber-700); font-size: 11px; font-weight: 600; padding: 2px 7px; border-radius: 20px; }
hr     { border: none; border-top: 1px solid var(--border); margin: 14px 0; }

/* ---- PERMIT NOTES ---- */
.notes-card { padding-bottom: 0; }
.notes-count-badge { margin-left: auto; background: var(--green-100); color: var(--green-700); font-size: 11px; font-weight: 700; padding: 1px 7px; border-radius: 20px; }
.notes-section-label { font-size: 11px; font-weight: 700; color: var(--amber-600); text-transform: uppercase; letter-spacing: 0.05em; margin: 4px 0 8px; }
.notes-divider { border: none; border-top: 1px dashed var(--border); margin: 12px 0; }
.notes-empty   { font-size: 13px; color: var(--gray-700); padding: 12px 0 4px; font-style: italic; }

.note-bubble { background: var(--bg); border-radius: var(--radius-sm); border: 1px solid var(--border); padding: 10px 12px; margin-bottom: 8px; transition: border-color 0.15s; }
.note-bubble.note-own       { background: var(--green-100); border-color: var(--green-200); }
.note-bubble.note-important { background: var(--amber-50); border-color: rgba(186,117,23,0.35); border-left: 3px solid var(--amber-600); }

.note-header  { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; flex-wrap: wrap; }
.note-avatar  { width: 28px; height: 28px; border-radius: 50%; flex-shrink: 0; background: var(--green-200); color: var(--green-800); display: flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; }
.note-own .note-avatar { background: var(--green-400); color: var(--green-900); }
.note-meta    { flex: 1; min-width: 0; }
.note-author  { font-size: 13px; font-weight: 600; color: var(--gray-900); display: block; }
.note-time    { font-size: 11px; color: var(--gray-700); }
.note-flag    { font-size: 11px; font-weight: 700; color: var(--amber-600); background: var(--amber-100); padding: 2px 7px; border-radius: 20px; white-space: nowrap; }
.note-actions { display: flex; gap: 4px; margin-left: auto; flex-shrink: 0; }
.note-action-btn { border: none; background: none; cursor: pointer; font-size: 15px; color: var(--gray-400); padding: 2px 4px; border-radius: 4px; line-height: 1; transition: color 0.1s, background 0.1s; }
.note-action-btn:hover { color: var(--gray-700); background: var(--gray-200); }
.note-delete-btn:hover { color: var(--red-700); background: var(--red-100); }
.note-text       { font-size: 14px; color: var(--gray-900); line-height: 1.55; white-space: pre-wrap; word-break: break-word; }
.note-edit-input { width: 100%; padding: 8px 10px; border-radius: var(--radius-sm); border: 1px solid var(--border-md); background: var(--surface); color: var(--gray-900); font-size: 14px; font-family: var(--font); resize: vertical; min-height: 70px; }
.note-edit-input:focus { outline: none; border-color: var(--green-600); }

.notes-compose        { border-top: 1px solid var(--border); padding: 12px 0 4px; margin-top: 8px; }
.notes-compose-input  { width: 100%; padding: 10px 12px; border-radius: var(--radius-sm); border: 1px solid var(--border-md); background: var(--surface); color: var(--gray-900); font-size: 14px; font-family: var(--font); resize: vertical; min-height: 72px; line-height: 1.5; }
.notes-compose-input:focus { outline: none; border-color: var(--green-600); box-shadow: 0 0 0 3px rgba(99,153,34,0.12); }
.notes-compose-input::placeholder { color: var(--gray-400); }
.notes-compose-footer { display: flex; align-items: center; justify-content: space-between; margin-top: 8px; gap: 8px; padding-bottom: 8px; }
.notes-important-toggle { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--gray-700); cursor: pointer; }
.notes-important-toggle input { cursor: pointer; }

/* ---- CONTENT AREA ---- */
.content-area {
  flex: 1;
  min-height: 0;
  overflow-y: scroll;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: contain;
}
.page { display: none; padding: 14px; }
.page.active { display: block; }

/* ---- MAP PAGE ---- */
#page-map { padding: 0 !important; }
#page-map.active { display: block !important; overflow: hidden; }
#mapContainer { position: relative; width: 100%; height: calc(100dvh - 160px); }
#googleMap { width: 100%; height: 100%; }

/* ---- DARK MODE ---- */
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #1a1e17; --surface: #242820; --border: rgba(255,255,255,0.10);
    --border-md: rgba(255,255,255,0.18); --gray-900: #f0ede8; --gray-700: #b0ada8;
    --gray-400: #888780; --gray-100: #2e3028; --green-100: #1d2e10;
    --green-200: #2a4217; --green-400: #639922;
    --amber-100: #2e2510; --amber-50: #2a2010;
    --red-100: #2e1515; --coral-100: #2e1a12;
  }
  .field input, .field select, .field textarea { background: var(--bg); }
  .filter-bar input, .filter-bar select { background: var(--surface); color: var(--gray-900); }
  .disp-select { background: var(--surface); color: var(--gray-900); }
  .loading-overlay { background: rgba(26,30,23,0.9); }
  .note-edit-input { background: var(--surface); }
  .notes-compose-input { background: var(--surface); }
}
