:root {
  color-scheme: light;
  --ink: #10251f;
  --muted: #66766f;
  --green: #0e7a5f;
  --green-dark: #075c47;
  --mint: #dff5ea;
  --paper: #fbfdfb;
  --card: #ffffff;
  --line: #dbe5df;
  --danger: #b3261e;
  --shadow: 0 18px 60px rgba(16, 37, 31, 0.1);
  font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-synthesis: none;
}

* { box-sizing: border-box; }
html { min-height: 100%; background: var(--paper); }
body { margin: 0; min-height: 100%; color: var(--ink); background: var(--paper); }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }

.app-shell { min-height: 100dvh; padding-bottom: calc(92px + env(safe-area-inset-bottom)); }
.topbar {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: calc(14px + env(safe-area-inset-top)) clamp(18px, 4vw, 56px) 14px;
  border-bottom: 1px solid rgba(219, 229, 223, 0.8);
  background: rgba(251, 253, 251, 0.92);
  backdrop-filter: blur(18px);
  position: sticky;
  top: 0;
  z-index: 5;
}
.brand { display: flex; gap: 11px; align-items: center; color: inherit; text-decoration: none; }
.brand img { border-radius: 12px; box-shadow: 0 5px 15px rgba(14, 122, 95, 0.18); }
.brand span { display: grid; gap: 1px; }
.brand strong { font-size: 15px; letter-spacing: -0.01em; }
.brand small { color: var(--muted); font-size: 11px; }

main { width: min(100%, 1040px); margin: 0 auto; }
.view { padding: clamp(30px, 7vw, 76px) clamp(20px, 5vw, 64px) 36px; }
.hero { max-width: 680px; }
.hero.compact { max-width: 620px; }
.eyebrow { margin: 0 0 10px; color: var(--green); font-size: 11px; font-weight: 800; letter-spacing: 0.16em; }
h1 { margin: 0; max-width: 650px; font-size: clamp(38px, 7.5vw, 68px); line-height: 0.99; letter-spacing: -0.055em; }
.hero > p:last-child { margin: 20px 0 0; max-width: 600px; color: var(--muted); font-size: clamp(16px, 2.5vw, 19px); line-height: 1.6; }

.drop-zone {
  width: 100%;
  min-height: 240px;
  margin-top: clamp(30px, 6vw, 56px);
  padding: 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 9px;
  border: 1.5px dashed #9db9ad;
  border-radius: 30px;
  color: var(--ink);
  background: linear-gradient(145deg, #f0faf5, #ffffff);
  cursor: pointer;
  transition: transform 160ms ease, border-color 160ms ease, box-shadow 160ms ease;
}
.drop-zone:hover, .drop-zone:focus-visible, .drop-zone.is-over { transform: translateY(-2px); border-color: var(--green); box-shadow: var(--shadow); outline: none; }
.drop-zone strong { font-size: 18px; }
.drop-zone > span:last-child { color: var(--muted); }
.drop-icon { display: grid; place-items: center; width: 58px; height: 58px; margin-bottom: 6px; color: white; background: var(--green); border-radius: 18px; }
.drop-icon svg { width: 27px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

.trust-row { margin: 20px 4px 0; display: flex; justify-content: center; flex-wrap: wrap; gap: 10px 24px; color: var(--muted); font-size: 13px; }
.trust-row span { display: flex; align-items: center; gap: 7px; }
.trust-row i { width: 18px; height: 18px; display: grid; place-items: center; border-radius: 50%; color: var(--green); background: var(--mint); font-size: 11px; font-style: normal; font-weight: 800; }
.note-card { display: flex; gap: 14px; align-items: flex-start; margin-top: 42px; padding: 18px; border: 1px solid var(--line); border-radius: 20px; background: var(--card); }
.note-card > span { flex: 0 0 26px; width: 26px; height: 26px; display: grid; place-items: center; color: var(--green); background: var(--mint); border-radius: 50%; font-weight: 800; }
.note-card p { display: grid; gap: 4px; margin: 1px 0 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.note-card strong { color: var(--ink); }

.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 20px; margin-bottom: 30px; }
.section-heading h1 { font-size: clamp(38px, 6vw, 58px); }
.count-pill { margin-bottom: 5px; padding: 7px 11px; color: var(--green-dark); background: var(--mint); border-radius: 99px; font-size: 12px; font-weight: 700; }
.media-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(170px, 1fr)); gap: 14px; }
.media-card { position: relative; overflow: hidden; aspect-ratio: 0.82; padding: 0; border: 0; border-radius: 22px; background: #e7eee9; cursor: pointer; box-shadow: 0 4px 16px rgba(16, 37, 31, 0.06); }
.media-card img, .media-card video { width: 100%; height: 100%; object-fit: cover; display: block; transition: transform 180ms ease; }
.media-card:hover img, .media-card:hover video { transform: scale(1.025); }
.media-card::after { content: ""; position: absolute; inset: 55% 0 0; background: linear-gradient(transparent, rgba(4, 18, 13, 0.7)); pointer-events: none; }
.media-card .media-meta { position: absolute; z-index: 1; left: 13px; right: 13px; bottom: 12px; display: flex; align-items: flex-end; justify-content: space-between; gap: 10px; color: white; text-align: left; }
.media-meta strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 12px; }
.type-chip { flex: none; padding: 4px 7px; border-radius: 99px; background: rgba(8, 29, 22, 0.68); font-size: 9px; font-weight: 800; letter-spacing: 0.08em; }
.empty-state { min-height: 390px; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center; }
.empty-state[hidden] { display: none; }
.empty-icon { width: 64px; height: 64px; display: grid; place-items: center; color: var(--green); background: var(--mint); border-radius: 22px; font-size: 31px; }
.empty-state h2 { margin: 20px 0 7px; font-size: 22px; }
.empty-state p { margin: 0 0 22px; color: var(--muted); }

.privacy-list { margin: 45px 0 30px; border-top: 1px solid var(--line); }
.privacy-list article { display: grid; grid-template-columns: 54px 1fr; gap: 18px; padding: 23px 2px; border-bottom: 1px solid var(--line); }
.privacy-list article > span { color: var(--green); font-size: 13px; font-weight: 800; }
.privacy-list h2 { margin: 0 0 5px; font-size: 17px; }
.privacy-list p { margin: 0; color: var(--muted); line-height: 1.5; }
.policy-links { display: flex; gap: 18px; margin: 24px 2px 0; font-size: 13px; }
.policy-links a { color: var(--green-dark); font-weight: 700; }

.primary-button, .secondary-button, .danger-button, .quiet-button, .text-danger, .icon-button { min-height: 44px; border-radius: 14px; border: 0; padding: 0 18px; cursor: pointer; font-weight: 750; }
.primary-button { color: white; background: var(--green); }
.primary-button:hover { background: var(--green-dark); }
.secondary-button { color: var(--green-dark); background: var(--mint); }
.quiet-button { min-height: 38px; color: var(--green-dark); background: var(--mint); }
.danger-button { color: white; background: var(--danger); }
.danger-button:disabled { color: #8b9691; background: #e6ebe8; cursor: default; }
.text-danger { color: var(--danger); background: transparent; }
.icon-button { width: 42px; min-height: 42px; padding: 0; color: var(--ink); background: #eef3f0; font-size: 28px; line-height: 1; }

.bottom-nav { position: fixed; z-index: 6; left: 50%; bottom: max(14px, env(safe-area-inset-bottom)); transform: translateX(-50%); display: flex; gap: 6px; padding: 7px; border: 1px solid rgba(219, 229, 223, 0.95); border-radius: 22px; background: rgba(255, 255, 255, 0.93); box-shadow: 0 12px 42px rgba(16, 37, 31, 0.15); backdrop-filter: blur(18px); }
.bottom-nav a { min-width: 92px; height: 54px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px; color: var(--muted); border-radius: 16px; text-decoration: none; font-size: 10px; font-weight: 750; }
.bottom-nav a[aria-current="page"] { color: var(--green-dark); background: var(--mint); }
.bottom-nav svg { width: 21px; height: 21px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; }

.preview-dialog { width: min(92vw, 720px); max-height: 90dvh; padding: 0; overflow: hidden; border: 0; border-radius: 26px; color: var(--ink); background: white; box-shadow: 0 30px 100px rgba(0, 0, 0, 0.3); }
.preview-dialog::backdrop { background: rgba(5, 19, 14, 0.73); backdrop-filter: blur(8px); }
.dialog-bar, .dialog-actions { display: flex; align-items: center; padding: 14px 16px; gap: 9px; }
.dialog-bar { justify-content: space-between; border-bottom: 1px solid var(--line); }
.dialog-bar strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.dialog-actions { justify-content: flex-end; border-top: 1px solid var(--line); }
.preview-media { min-height: 260px; height: min(61dvh, 620px); display: grid; place-items: center; background: #07150f; }
.preview-media img, .preview-media video { width: 100%; height: 100%; object-fit: contain; }
.toast { position: fixed; z-index: 20; left: 50%; bottom: 104px; transform: translate(-50%, 20px); padding: 11px 16px; color: white; background: #10251f; border-radius: 99px; opacity: 0; pointer-events: none; transition: 180ms ease; font-size: 13px; box-shadow: var(--shadow); }
.toast.is-visible { opacity: 1; transform: translate(-50%, 0); }

@media (min-width: 760px) {
  .app-shell { padding-bottom: 112px; }
  .bottom-nav a { min-width: 118px; }
  .note-card { max-width: 680px; }
}

@media (max-width: 480px) {
  .topbar { min-height: 68px; }
  .brand small { display: none; }
  .view { padding-top: 34px; }
  .drop-zone { min-height: 210px; border-radius: 24px; }
  .trust-row { justify-content: flex-start; }
  .bottom-nav { bottom: max(9px, env(safe-area-inset-bottom)); }
  .bottom-nav a { min-width: 83px; }
  .media-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .media-card { border-radius: 18px; }
  .dialog-actions { flex-wrap: wrap; }
  .dialog-actions .primary-button, .dialog-actions .secondary-button { flex: 1; }
}

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