:root { font-family: "Segoe UI", system-ui, sans-serif; color: #20332b; background: #f3f5f0; font-synthesis: none; --green: #245c45; --green-2: #34775a; --mint: #e4eee7; --line: #dce3dc; --muted: #6b7a72; --cream: #fbfcf9; }
* { box-sizing: border-box; }
.hidden { display: none !important; }
body { margin: 0; min-width: 320px; min-height: 100vh; background: radial-gradient(circle at 80% 0, #e7eee8 0, transparent 30%), #f3f5f0; }
button, input, select, textarea { font: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
input, select, textarea { border: 1px solid #ced8d0; border-radius: 10px; background: #fff; color: #20332b; min-height: 43px; padding: 9px 11px; outline: none; }
input:focus, select:focus, textarea:focus { border-color: var(--green-2); box-shadow: 0 0 0 3px rgba(52,119,90,.13); }
label { font-size: 13px; font-weight: 600; color: #50635a; }
label > span:first-child { display: block; margin-bottom: 6px; }
h1, h2, p { margin-top: 0; }
h1, h2 { color: #1f3d30; }
h1 { font-family: Georgia, serif; font-size: clamp(28px, 4vw, 40px); line-height: 1.08; margin-bottom: 8px; }
h2 { font-size: 19px; margin: 0; }
.app-shell { min-height: 100vh; }
.topbar { height: 76px; padding: 0 max(20px, calc((100vw - 1180px) / 2)); display: flex; align-items: center; justify-content: space-between; background: rgba(251,252,249,.9); backdrop-filter: blur(16px); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 42px; height: 42px; border-radius: 13px; background: var(--green); color: white; display: grid; place-items: center; }
.brand strong, .brand small { display: block; }
.brand strong { font-size: 16px; }
.brand small { color: var(--muted); font-size: 11px; margin-top: 1px; }
nav { display: flex; gap: 5px; }
.nav-button { border: 0; background: transparent; color: #617168; display: flex; align-items: center; gap: 7px; border-radius: 10px; padding: 10px 13px; font-weight: 600; font-size: 13px; }
.nav-button:hover { background: #edf1ed; }
.nav-button.active { background: var(--mint); color: var(--green); }
.page { width: min(1180px, calc(100% - 40px)); margin: 0 auto; padding: 32px 0 70px; }
.loading { min-height: 100vh; display: grid; place-content: center; text-align: center; color: var(--green); }
.eyebrow { color: var(--green-2); text-transform: uppercase; font-weight: 700; font-size: 10px; letter-spacing: .12em; display: block; margin-bottom: 7px; }
.page-title { margin-bottom: 25px; }
.page-title p { color: var(--muted); max-width: 650px; }
.context-card, .filter-card { display: grid; grid-template-columns: 1.1fr 1.3fr 1fr .8fr 1.25fr; gap: 12px; padding: 15px; background: rgba(251,252,249,.88); border: 1px solid var(--line); border-radius: 16px; box-shadow: 0 5px 25px rgba(34,70,52,.04); margin-bottom: 18px; }
.context-card select, .context-card input, .filter-card select, .filter-card input { width: 100%; border: 0; background: #eff3ef; }
.window-badge { background: var(--green); color: white; border-radius: 11px; padding: 8px 15px; display: flex; justify-content: center; flex-direction: column; }
.window-badge small { opacity: .75; font-size: 10px; text-transform: uppercase; letter-spacing: .08em; }
.window-badge strong { margin-top: 3px; font-size: 14px; }
.capture-grid { display: grid; grid-template-columns: minmax(0, 1.7fr) minmax(280px, .8fr); gap: 18px; }
.entry-card, .maxima-card, .raw-card, .table-card, .archive-table, .manage-card { background: var(--cream); border: 1px solid var(--line); border-radius: 18px; box-shadow: 0 7px 28px rgba(34,70,52,.05); }
.entry-card { padding: 27px 28px 22px; position: relative; }
.maxima-card { padding: 23px; }
.raw-card { margin-top: 18px; padding: 22px 24px; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.section-heading h1 { margin-bottom: 0; }
.shortcut, .metric { border: 1px solid var(--line); border-radius: 8px; color: var(--muted); padding: 5px 8px; font-size: 11px; font-weight: 700; background: #f4f6f3; }
.favorites { display: flex; gap: 7px; flex-wrap: wrap; margin-bottom: 18px; }
.favorites button, .species-chips button { border: 1px solid #cddbd1; border-radius: 999px; padding: 7px 10px; color: var(--green); background: #f1f6f2; font-size: 11px; font-weight: 600; display: flex; align-items: center; gap: 5px; }
.entry-form { display: grid; grid-template-columns: minmax(190px, 1fr) 150px 130px; gap: 11px; align-items: end; }
.species-input { width: 100%; height: 56px; font-size: 19px; padding-left: 16px; border-width: 2px; }
.autocomplete { position: relative; }
.suggestions { list-style: none; margin: 5px 0 0; padding: 6px; position: absolute; top: 100%; left: 0; right: 0; z-index: 10; border: 1px solid var(--line); border-radius: 12px; background: white; box-shadow: 0 15px 35px rgba(25,57,42,.18); }
.suggestions li button { width: 100%; border: 0; background: transparent; border-radius: 8px; padding: 10px; text-align: left; }
.suggestions li.active button, .suggestions li button:hover { background: var(--mint); }
.suggestions span, .suggestions small { display: block; }
.suggestions small { color: var(--muted); margin-top: 2px; }
.stepper { display: grid; grid-template-columns: 38px 1fr 38px; height: 56px; border: 1px solid #ced8d0; border-radius: 10px; overflow: hidden; background: white; }
.stepper input { width: 100%; border: 0; border-radius: 0; font-size: 20px; text-align: center; padding: 0; -moz-appearance: textfield; }
.stepper input::-webkit-inner-spin-button { display: none; }
.stepper button { border: 0; color: var(--green); background: #eef3ef; display: grid; place-items: center; }
.primary, .file-button { border: 0; background: var(--green); color: white; border-radius: 10px; min-height: 43px; padding: 10px 14px; font-weight: 700; display: inline-flex; align-items: center; justify-content: center; gap: 7px; }
.save-button { height: 56px; }
.entry-hint { color: var(--muted); font-size: 11px; margin: 14px 0 0; }
.toast { position: absolute; left: 28px; bottom: -15px; z-index: 3; border-radius: 999px; background: #173e2d; color: white; padding: 9px 14px; box-shadow: 0 8px 20px rgba(23,62,45,.2); display: flex; align-items: center; gap: 7px; font-size: 12px; }
.maxima-list { display: grid; gap: 2px; }
.maxima-list > div { display: flex; justify-content: space-between; padding: 10px 4px; border-bottom: 1px solid #e7ebe7; }
.maxima-list strong { min-width: 30px; height: 30px; border-radius: 9px; background: var(--mint); color: var(--green); display: grid; place-items: center; }
.raw-list { display: grid; }
.raw-row { display: grid; grid-template-columns: 55px 1fr 40px 32px 32px; align-items: center; gap: 10px; padding: 10px 2px; border-top: 1px solid #e8ece8; }
.raw-row time { color: var(--green); font-weight: 700; }
.raw-row div strong, .raw-row div small { display: block; }
.raw-row div small { color: var(--muted); font-size: 10px; margin-top: 2px; }
.raw-row b { text-align: center; }
.icon-button { width: 32px; height: 32px; border: 0; border-radius: 8px; color: #68776f; background: transparent; display: grid; place-items: center; }
.icon-button:hover { background: #e9eeea; }
.icon-button.danger:hover { color: #a13f35; background: #f8e9e7; }
.empty { min-height: 105px; color: #829087; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 8px; text-align: center; font-size: 12px; }
.filter-card { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.summary-strip { display: grid; grid-template-columns: repeat(4, 1fr); background: var(--green); color: white; border-radius: 16px; padding: 18px 22px; margin-bottom: 18px; }
.summary-strip > div { padding: 3px 18px; border-right: 1px solid rgba(255,255,255,.15); }
.summary-strip > div:last-child { border: 0; }
.summary-strip small, .summary-strip strong { display: block; }
.summary-strip small { opacity: .68; font-size: 10px; text-transform: uppercase; letter-spacing: .07em; }
.summary-strip strong { font-size: 19px; margin-top: 4px; }
.table-card { overflow: hidden; }
.table-head { display: grid; grid-template-columns: 1fr 160px; background: #e7ede8; padding: 12px 24px; color: var(--muted); text-transform: uppercase; font-size: 10px; letter-spacing: .08em; font-weight: 700; }
.table-head span:last-child { text-align: right; }
.day-item { border-top: 1px solid var(--line); }
.day-item:first-of-type { border: 0; }
.day-item > button { width: 100%; display: grid; grid-template-columns: 28px 1fr 160px; align-items: center; padding: 15px 22px; border: 0; background: white; text-align: left; color: #263d32; }
.day-item > button:hover { background: #f7f9f6; }
.day-item > button strong { text-align: right; color: var(--green); font-size: 17px; }
.hour-details { background: #f1f5f1; margin: 0 22px 15px 50px; border-radius: 10px; padding: 5px 13px; }
.hour-details > div { display: flex; justify-content: space-between; padding: 8px; border-bottom: 1px solid #dce5dd; font-size: 12px; }
.hour-details > div:last-child { border: 0; }
.archive-filters { grid-template-columns: repeat(5, minmax(0, 1fr)); }
.export-bar { display: flex; align-items: center; justify-content: space-between; margin: 15px 2px; color: var(--muted); }
.export-bar div { display: flex; gap: 7px; }
.export-bar button { border: 1px solid #ccd8cf; color: var(--green); background: white; border-radius: 9px; padding: 8px 11px; display: flex; align-items: center; gap: 6px; font-weight: 700; }
.archive-table { overflow: hidden; }
.archive-head, .archive-row { display: grid; grid-template-columns: 1.25fr 1.3fr 1fr 1fr 70px 40px; align-items: center; gap: 12px; padding: 12px 20px; }
.archive-head { background: #e7ede8; color: var(--muted); text-transform: uppercase; font-size: 9px; font-weight: 700; letter-spacing: .08em; }
.archive-row { background: white; border-top: 1px solid var(--line); font-size: 12px; }
.archive-row span small { display: block; color: var(--muted); font-size: 9px; margin-top: 2px; }
.settings-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
.manage-card { padding: 22px; }
.add-row { display: flex; gap: 8px; }
.add-row input { flex: 1; min-width: 0; }
.simple-list { list-style: none; margin: 15px 0 0; padding: 0; max-height: 155px; overflow: auto; }
.simple-list li { border-top: 1px solid #e6ebe6; padding: 9px 3px; font-size: 13px; }
.species-manage { grid-column: 1 / -1; }
.species-chips { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 16px; max-height: 180px; overflow: auto; }
.species-chips button { background: white; color: var(--muted); }
.species-chips button.favorite { color: #8b6a13; border-color: #dfcc8d; background: #fff9e8; }
.manage-card p { color: var(--muted); font-size: 12px; line-height: 1.5; }
.file-button { cursor: pointer; width: fit-content; font-size: 13px; }
.file-button input { display: none; }
.file-button.secondary { color: var(--green); background: var(--mint); }
.import-preview { margin-top: 14px; padding: 13px; border: 1px solid var(--line); border-radius: 10px; background: #f5f8f5; }
.import-preview > div { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 12px; font-size: 11px; }
.success { color: #277048; }.danger-text { color: #a13f35 !important; }
.backup-actions { display: flex; gap: 8px; flex-wrap: wrap; }
.inline-notice { background: #e1eee5; border: 1px solid #bfd5c6; color: #245c45; padding: 11px 14px; border-radius: 10px; margin-bottom: 17px; }
.modal-backdrop { position: fixed; inset: 0; z-index: 50; background: rgba(21,39,30,.45); backdrop-filter: blur(3px); display: grid; place-items: center; padding: 20px; }
.modal { width: min(610px, 100%); max-height: calc(100vh - 40px); overflow: auto; background: white; border-radius: 17px; padding: 22px; box-shadow: 0 25px 70px rgba(15,36,25,.25); }
.modal > header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 20px; }
.form-stack { display: grid; gap: 14px; }
.form-stack label { display: grid; gap: 6px; }
.form-row { display: grid; grid-template-columns: 1.2fr 1fr .7fr; gap: 10px; }
textarea { min-height: 80px; resize: vertical; }
.modal-actions { display: flex; justify-content: flex-end; gap: 8px; }
.modal-actions > button:not(.primary) { border: 1px solid var(--line); background: white; border-radius: 10px; padding: 9px 13px; }

@media (max-width: 850px) {
  .topbar { height: auto; min-height: 68px; padding: 9px 16px; }
  .brand small { display: none; }
  .nav-button span { display: none; }
  .nav-button { padding: 10px; }
  .page { width: min(100% - 26px, 720px); padding-top: 20px; }
  .context-card { grid-template-columns: repeat(2, 1fr); }
  .window-badge { grid-column: 1 / -1; }
  .capture-grid { grid-template-columns: 1fr; }
  .entry-form { grid-template-columns: 1fr 145px; }
  .save-button { grid-column: 1 / -1; }
  .archive-filters { grid-template-columns: repeat(2, 1fr); }
  .archive-table { overflow-x: auto; }
  .archive-head, .archive-row { min-width: 750px; }
}

@media (max-width: 560px) {
  .brand strong { font-size: 14px; }
  .brand-mark { width: 37px; height: 37px; }
  .page { width: calc(100% - 20px); padding-bottom: 90px; }
  .context-card { gap: 8px; padding: 10px; }
  .context-card label:nth-child(3), .context-card label:nth-child(4) { width: 100%; }
  .entry-card { padding: 21px 17px 19px; }
  .maxima-card, .raw-card, .manage-card { padding: 18px 16px; }
  .shortcut { display: none; }
  .entry-form { grid-template-columns: 1fr 120px; }
  .species-field { grid-column: 1 / -1; }
  .save-button { grid-column: auto; }
  .toast { left: 12px; right: 12px; justify-content: center; }
  .summary-strip { grid-template-columns: repeat(2, 1fr); padding: 11px; }
  .summary-strip > div { border: 0; padding: 9px; }
  .filter-card { grid-template-columns: 1fr; }
  .archive-filters { grid-template-columns: repeat(2, 1fr); }
  .settings-grid { grid-template-columns: 1fr; }
  .species-manage { grid-column: auto; }
  .add-row { flex-direction: column; }
  .form-row { grid-template-columns: 1fr; }
  .raw-row { grid-template-columns: 45px 1fr 30px 30px 30px; gap: 5px; }
}
