:root {
  --bg: #faf8f5;
  --ink: #1b4332;
  --accent: #2d6a4f;
  --line: #d8d3cb;
  --surface: #fff;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.5 system-ui, -apple-system, sans-serif;
}

.app-bar {
  position: sticky;
  top: 0;
  z-index: 5;
  display: flex;
  gap: .5rem;
  align-items: center;
  padding: 1rem max(1rem, env(safe-area-inset-left));
  background: var(--bg);
  border-bottom: 1px solid var(--line);
}

.app-bar h1 { font-size: 1.1rem; margin: 0 auto 0 0; }
#feed { max-width: 42rem; margin: 0 auto; padding: 1rem; display: grid; gap: 1rem; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1rem;
}

.card-head { display: flex; justify-content: space-between; align-items: center; }
.badge { font-size: .75rem; text-transform: uppercase; color: var(--accent); }
.card-text { margin: .75rem 0; }
.card-foot { display: flex; gap: .75rem; margin-top: 1rem; }

button {
  font: inherit;
  min-height: 44px;
  padding: .5rem .9rem;
  border-radius: 10px;
  border: 1px solid var(--accent);
  background: transparent;
  color: var(--accent);
  cursor: pointer;
}

button:active { background: rgb(45 106 79 / .08); }

.privacy-link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: .5rem .9rem;
  border: 1px solid var(--accent);
  border-radius: 10px;
  color: var(--accent);
}
.install[hidden], .icon-button[hidden] { display: none; }

.scrim { position: fixed; inset: 0; background: rgb(0 0 0 / .45); z-index: 10; }

.sheet {
  position: fixed;
  z-index: 11;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  overflow-y: auto;
  background: var(--surface);
  border-radius: 20px 20px 0 0;
  padding: 1.25rem 1.25rem max(1.25rem, env(safe-area-inset-bottom));
}

@media (min-width: 720px) {
  .sheet {
    left: 50%;
    right: auto;
    bottom: auto;
    top: 50%;
    width: min(32rem, 90vw);
    transform: translate(-50%, -50%);
    border-radius: 18px;
  }
}

.sheet-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; }
.sheet-head h2 { font-size: 1.15rem; margin: 0; }
.sheet-close { min-height: 44px; min-width: 44px; padding: 0; }
#sheet-reasons { padding: 0; margin: 1rem 0 0; }

.reason {
  display: flex;
  gap: .75rem;
  align-items: center;
  padding: .6rem 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}

.reason-icon { font-size: 1.25rem; }
.reason-text { flex: 1; }
.reason-action { margin-left: auto; font-size: .9rem; }
.modal-open { overflow: hidden; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; }

#toast {
  position: fixed;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  max-width: 90vw;
  background: var(--ink);
  color: var(--surface);
  padding: .75rem 1rem;
  border-radius: 10px;
  z-index: 20;
}

#toast:empty { display: none; }

@media (prefers-reduced-motion: reduce) {
  * { animation: none !important; transition: none !important; }
}

.sheet-global { display: flex; gap: .75rem; margin-top: 1.25rem; flex-wrap: wrap; }
.survey { margin-top: 1.25rem; }
.survey-options { display: flex; gap: .5rem; }
.survey-options button { min-width: 48px; }

#privacy-banner {
  position: fixed;
  z-index: 15;
  left: 1rem;
  right: 1rem;
  bottom: calc(1rem + env(safe-area-inset-bottom));
  max-width: 40rem;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--accent);
  border-radius: 14px;
  padding: 1rem;
  box-shadow: 0 8px 24px rgb(0 0 0 / .12);
}

#privacy-banner p { margin: 0 0 .75rem; font-size: .9rem; }
#privacy-banner[hidden] { display: none; }
