:root {
  --ink: #14211d;
  --muted: #65736d;
  --paper: #f3f0e8;
  --card: #fffdf8;
  --line: #dedbd1;
  --green: #173f35;
  --green-2: #255f50;
  --lime: #d9ef7f;
  --orange: #e86f45;
  --shadow: 0 14px 40px rgba(26, 47, 39, .12);
  --radius: 22px;
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI", sans-serif;
  color: var(--ink);
  background: var(--paper);
  font-synthesis: none;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--paper);
}

body {
  min-height: 100dvh;
  -webkit-tap-highlight-color: transparent;
}

button, input, textarea, select { font: inherit; }
button { color: inherit; }

.app-shell {
  width: min(100%, 560px);
  min-height: 100dvh;
  margin: 0 auto;
  position: relative;
  padding-bottom: calc(96px + env(safe-area-inset-bottom));
  background:
    radial-gradient(circle at 100% 0, rgba(217, 239, 127, .24), transparent 280px),
    var(--paper);
}

.topbar {
  height: calc(76px + env(safe-area-inset-top));
  padding: calc(14px + env(safe-area-inset-top)) 20px 10px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  border: 0;
  background: none;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 11px;
  text-align: left;
}

.brand-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  background: var(--green);
  color: var(--lime);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: -.03em;
  transform: rotate(-3deg);
}

.brand strong, .brand small { display: block; }
.brand strong { font-size: 15px; letter-spacing: -.02em; }
.brand small { color: var(--muted); font-size: 10px; margin-top: 1px; }

.icon-button {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(255, 253, 248, .7);
  font-weight: 800;
}

main { padding: 12px 18px 20px; }

.hero { padding: 18px 4px 22px; }
.hero h1, .empty-state h1 {
  margin: 7px 0 10px;
  max-width: 430px;
  font-size: clamp(36px, 10vw, 52px);
  line-height: .98;
  letter-spacing: -.055em;
}

.hero p, .empty-state > p {
  color: var(--muted);
  line-height: 1.55;
  margin: 0;
  max-width: 430px;
}

.eyebrow {
  margin: 0;
  color: var(--green-2) !important;
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .13em;
  text-transform: uppercase;
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  margin: 12px 3px;
}

.section-heading h2 {
  margin: 0;
  font-size: 20px;
  letter-spacing: -.035em;
}

.text-button {
  padding: 6px;
  border: 0;
  background: none;
  color: var(--green-2);
  font-size: 13px;
  font-weight: 750;
}

.project-grid { display: grid; gap: 13px; }

.project-card {
  width: 100%;
  border: 1px solid rgba(222, 219, 209, .8);
  border-radius: var(--radius);
  padding: 20px;
  background: var(--card);
  box-shadow: 0 5px 16px rgba(25, 48, 40, .05);
  text-align: left;
  overflow: hidden;
  position: relative;
}

.project-card::after {
  content: "";
  width: 100px;
  height: 100px;
  border-radius: 28px;
  position: absolute;
  right: -46px;
  top: -50px;
  background: var(--project-color, var(--lime));
  opacity: .5;
  transform: rotate(20deg);
}

.project-topline, .entry-topline, .weather-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.status {
  padding: 6px 9px;
  border-radius: 99px;
  background: #e9f2de;
  color: #315236;
  font-size: 10px;
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: .08em;
}

.project-card h3 {
  margin: 19px 0 4px;
  font-size: 24px;
  letter-spacing: -.04em;
}

.project-card > p { color: var(--muted); margin: 0; font-size: 13px; }

.project-stats {
  display: flex;
  gap: 22px;
  margin-top: 22px;
  padding-top: 15px;
  border-top: 1px solid var(--line);
}

.stat strong, .stat span { display: block; }
.stat strong { font-size: 17px; }
.stat span { margin-top: 2px; color: var(--muted); font-size: 10px; }
.arrow { margin-left: auto; align-self: center; color: var(--green-2); font-size: 23px; }

.quick-card {
  margin: 18px 0;
  padding: 18px;
  display: flex;
  align-items: center;
  gap: 15px;
  border-radius: var(--radius);
  background: var(--green);
  color: white;
  box-shadow: var(--shadow);
}

.quick-card button {
  margin-left: auto;
  flex: 0 0 auto;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 50%;
  background: var(--lime);
  color: var(--green);
  font-size: 28px;
}

.quick-card strong, .quick-card small { display: block; }
.quick-card small { margin-top: 4px; color: rgba(255,255,255,.67); font-size: 11px; }

.bottom-nav {
  position: fixed;
  z-index: 10;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: min(100%, 560px);
  height: calc(76px + env(safe-area-inset-bottom));
  padding: 10px 48px env(safe-area-inset-bottom);
  display: flex;
  align-items: start;
  justify-content: space-between;
  background: rgba(255, 253, 248, .9);
  border-top: 1px solid rgba(222, 219, 209, .85);
  backdrop-filter: blur(18px);
}

.nav-item {
  width: 58px;
  border: 0;
  background: none;
  color: #8a938f;
  font-size: 10px;
  display: grid;
  gap: 3px;
  justify-items: center;
}

.nav-icon { font-size: 21px; line-height: 1; font-weight: 500; }
.nav-item.is-active { color: var(--green); font-weight: 750; }

.nav-add {
  width: 58px;
  height: 58px;
  margin-top: -30px;
  border: 5px solid var(--paper);
  border-radius: 50%;
  background: var(--orange);
  color: white;
  font-size: 34px;
  line-height: 1;
  box-shadow: 0 8px 22px rgba(232, 111, 69, .34);
}

.empty-state {
  min-height: calc(100dvh - 180px);
  padding: 5vh 4px 20px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
}

.empty-illustration {
  width: 100%;
  height: 190px;
  margin-bottom: 28px;
  position: relative;
  border-radius: 28px;
  background: var(--green);
  overflow: hidden;
}

.empty-illustration::before {
  content: "";
  position: absolute;
  width: 160px;
  height: 160px;
  border: 2px solid rgba(217,239,127,.35);
  border-radius: 50%;
  right: -30px;
  top: -45px;
}

.empty-illustration span {
  position: absolute;
  bottom: 32px;
  width: 54px;
  border-radius: 5px 5px 0 0;
  background: var(--lime);
}

.empty-illustration span:nth-child(1) { height: 74px; left: 48px; }
.empty-illustration span:nth-child(2) { height: 110px; left: 112px; opacity: .75; }
.empty-illustration span:nth-child(3) { height: 52px; left: 176px; opacity: .45; }

.primary-button, .secondary-button, .danger-button {
  min-height: 52px;
  padding: 0 20px;
  border-radius: 15px;
  font-weight: 800;
}

.primary-button {
  border: 0;
  background: var(--green);
  color: white;
  box-shadow: 0 8px 20px rgba(23, 63, 53, .18);
}

.secondary-button { border: 1px solid var(--line); background: var(--card); }
.danger-button { border: 1px solid #edc4ba; background: #fff5f2; color: #9f3b25; }
.empty-state .primary-button { margin-top: 24px; }
.full-width { width: 100%; }

.project-header {
  margin: 6px 0 18px;
  padding: 24px 22px;
  border-radius: 28px;
  background: var(--green);
  color: white;
  overflow: hidden;
  position: relative;
}

.project-header::after {
  content: "";
  position: absolute;
  width: 180px;
  height: 180px;
  top: -100px;
  right: -80px;
  border: 34px solid rgba(217,239,127,.15);
  border-radius: 50%;
}

.back-button {
  padding: 0;
  border: 0;
  background: none;
  color: rgba(255,255,255,.72);
  font-size: 12px;
}

.project-header h1 { margin: 38px 0 4px; font-size: 32px; letter-spacing: -.045em; }
.project-header p { margin: 0; color: rgba(255,255,255,.62); font-size: 13px; }

.project-meta {
  display: flex;
  gap: 24px;
  margin-top: 22px;
}

.project-meta strong, .project-meta span { display: block; }
.project-meta strong { color: var(--lime); font-size: 19px; }
.project-meta span { color: rgba(255,255,255,.57); font-size: 10px; margin-top: 2px; }

.search {
  width: 100%;
  height: 48px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: rgba(255,253,248,.8);
  color: var(--ink);
  outline: none;
}

.entry-list { display: grid; gap: 12px; margin-top: 14px; }

.entry-card {
  padding: 17px;
  border: 1px solid var(--line);
  border-radius: 19px;
  background: var(--card);
}

.date-badge {
  min-width: 49px;
  padding: 8px 6px;
  border-radius: 12px;
  background: #edf0e8;
  text-align: center;
}

.date-badge strong, .date-badge span { display: block; }
.date-badge strong { font-size: 18px; line-height: 1; }
.date-badge span { margin-top: 3px; font-size: 9px; color: var(--muted); text-transform: uppercase; }
.entry-title { flex: 1; min-width: 0; }
.entry-title h3 { margin: 0; font-size: 16px; letter-spacing: -.02em; }
.entry-title p { margin: 4px 0 0; color: var(--muted); font-size: 11px; }
.entry-card > p { margin: 13px 0; color: #46534e; font-size: 13px; line-height: 1.5; }

.entry-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tag {
  padding: 5px 8px;
  border-radius: 8px;
  background: #f0eee7;
  color: #53605b;
  font-size: 10px;
  font-weight: 700;
}

.thumb-strip { display: flex; gap: 7px; margin-top: 12px; overflow-x: auto; }
.thumb-strip img, .photo-preview img {
  object-fit: cover;
  background: #e5e2d9;
}
.thumb-strip img { width: 68px; height: 68px; border-radius: 11px; flex: 0 0 auto; }

.sheet {
  width: min(100%, 560px);
  max-height: 92dvh;
  margin: auto auto 0;
  padding: 0;
  border: 0;
  border-radius: 28px 28px 0 0;
  background: var(--card);
  color: var(--ink);
  overflow: auto;
  box-shadow: 0 -12px 50px rgba(0,0,0,.22);
}

.sheet::backdrop { background: rgba(11, 29, 24, .52); backdrop-filter: blur(3px); }
.sheet-handle { width: 38px; height: 5px; margin: 10px auto 0; border-radius: 9px; background: #d1cec6; }
.sheet-body { padding: 15px 20px calc(28px + env(safe-area-inset-bottom)); }
.sheet-heading { display: flex; justify-content: space-between; align-items: start; margin-bottom: 20px; }
.sheet-heading h2 { margin: 0; font-size: 27px; letter-spacing: -.045em; }
.sheet-heading p { margin: 5px 0 0; color: var(--muted); font-size: 12px; }
.close-button { width: 34px; height: 34px; border: 0; border-radius: 50%; background: #efede6; font-size: 19px; }

.form-grid { display: grid; gap: 15px; }
.field { display: grid; gap: 7px; }
.field label, .field-label { font-size: 11px; font-weight: 800; color: #40504a; }
.field input, .field textarea, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #faf8f2;
  color: var(--ink);
  outline: none;
}
.field input, .field select { height: 49px; padding: 0 13px; }
.field textarea { min-height: 108px; padding: 13px; resize: vertical; }
.field input:focus, .field textarea:focus, .field select:focus, .search:focus {
  border-color: var(--green-2);
  box-shadow: 0 0 0 3px rgba(37,95,80,.1);
}

.two-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }

.weather-options { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; }
.weather-option input { position: absolute; opacity: 0; pointer-events: none; }
.weather-option span {
  height: 56px;
  border: 1px solid var(--line);
  border-radius: 13px;
  display: grid;
  place-items: center;
  background: #faf8f2;
  font-size: 12px;
}
.weather-option input:checked + span { border-color: var(--green); background: #e8efe7; color: var(--green); font-weight: 800; }

.photo-picker {
  min-height: 92px;
  border: 1px dashed #aeb9b2;
  border-radius: 16px;
  display: grid;
  place-items: center;
  background: #f6f5ef;
  color: var(--green-2);
  text-align: center;
  cursor: pointer;
}
.photo-picker input { position: absolute; opacity: 0; pointer-events: none; }
.photo-picker strong, .photo-picker small { display: block; }
.photo-picker strong { font-size: 14px; }
.photo-picker small { color: var(--muted); font-size: 10px; margin-top: 4px; }
.photo-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 7px; }
.photo-preview img { width: 100%; aspect-ratio: 1; border-radius: 12px; }
.form-actions { display: grid; gap: 9px; margin-top: 7px; }
.form-message {
  margin: 2px 0 0;
  padding: 11px 12px;
  border-radius: 11px;
  background: #fff0ec;
  color: #8f301e;
  font-size: 12px;
  line-height: 1.4;
}

.empty-list { padding: 34px 18px; text-align: center; color: var(--muted); }
.empty-list strong { display: block; color: var(--ink); margin-bottom: 5px; }

.toast {
  position: fixed;
  z-index: 30;
  left: 50%;
  bottom: calc(92px + env(safe-area-inset-bottom));
  transform: translate(-50%, 20px);
  width: max-content;
  max-width: calc(100% - 40px);
  padding: 11px 16px;
  border-radius: 12px;
  background: var(--ink);
  color: white;
  font-size: 12px;
  opacity: 0;
  pointer-events: none;
  transition: .2s ease;
}
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

.settings-list { display: grid; gap: 9px; }
.settings-list button { width: 100%; }
.fine-print { color: var(--muted); font-size: 10px; line-height: 1.5; }

@media (min-width: 561px) {
  body { background: #d8ddd7; }
  .app-shell { box-shadow: 0 0 70px rgba(23,63,53,.14); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; }
}
