* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text-primary);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, sans-serif;
}

.container {
  max-width: 480px;
  margin: 0 auto;
  padding: 2rem 1.25rem 4rem;
}

h1, h2 { font-weight: 600; }

.subtitle {
  color: var(--text-secondary);
  margin-top: -0.5rem;
}

.card {
  background: var(--surface);
  border-radius: 16px;
  padding: 1.25rem;
  box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}

.field {
  display: block;
  margin-bottom: 1rem;
}

.field label {
  display: block;
  font-size: 0.875rem;
  color: var(--text-secondary);
  margin-bottom: 0.375rem;
}

input[type=text], input[type=email], input[type=time], input[type=number] {
  width: 100%;
  padding: 0.75rem;
  border-radius: 10px;
  border: 1px solid rgba(0,0,0,0.12);
  font-size: 1rem;
  background: var(--bg);
  color: var(--text-primary);
}

.checkbox-row {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.checkbox-row label {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  background: var(--bg);
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-size: 0.875rem;
}

button, .button {
  display: inline-block;
  width: 100%;
  padding: 0.85rem;
  border-radius: 12px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 1rem;
  font-weight: 600;
  cursor: pointer;
  text-align: center;
  text-decoration: none;
}

.button-secondary {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
}

/* Set by forms.js once a form has been sent, until the next page loads. */
form.is-submitting button {
  opacity: 0.6;
}

.error {
  background: #FBEAEA;
  color: #A23B3B;
  padding: 0.75rem 1rem;
  border-radius: 10px;
  margin-bottom: 1rem;
  font-size: 0.9rem;
}

.task-group h3 {
  font-size: 0.95rem;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-secondary);
  margin: 1.5rem 0 0.75rem;
}

.task-group:first-child h3 { margin-top: 0; }

.task-group.overdue h3 { color: var(--overdue); }

.task-row {
  margin-bottom: 0.6rem;
}

.task-tap {
  display: flex;
  align-items: flex-start;
  gap: 0.75rem;
  width: 100%;
  text-align: left;
  background: var(--surface);
  border-radius: 14px;
  padding: 1rem;
  border: none;
  font: inherit;
  color: inherit;
  cursor: pointer;
}

.task-tap:active { background: var(--bg); }

.task-tap .check {
  flex-shrink: 0;
  font-size: 1.4rem;
  line-height: 1;
  color: var(--accent);
  margin-top: 0.1rem;
}

.task-body {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
}

.task-body .title { font-weight: 600; }
.task-body .meta { font-size: 0.8rem; color: var(--text-secondary); }

.empty-state {
  color: var(--text-secondary);
  text-align: center;
  padding: 2rem 0;
}

.top-bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1rem;
}

.top-bar form { width: auto; }
.top-bar button.link {
  background: none;
  border: none;
  color: var(--text-secondary);
  width: auto;
  padding: 0;
  font-size: 0.85rem;
  text-decoration: underline;
}

.fab-row {
  position: fixed;
  right: 1.25rem;
  bottom: 1.5rem;
  left: 1.25rem;
  display: flex;
  justify-content: flex-end;
  gap: 0.6rem;
  z-index: 10;
}

.fab-button {
  width: auto;
  padding: 0.85rem 1.25rem;
  border-radius: 999px;
  box-shadow: 0 4px 14px rgba(0,0,0,0.18);
  white-space: nowrap;
}

.app-nav {
  display: flex;
  gap: 1.25rem;
  margin-bottom: 1.25rem;
}

.app-nav a {
  color: var(--text-secondary);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.feed-row {
  display: block;
  background: var(--surface);
  border-radius: 14px;
  padding: 1rem;
  margin-bottom: 0.6rem;
  color: inherit;
  text-decoration: none;
}

.feed-line { font-size: 0.95rem; }

.kudo-row {
  padding: 0.6rem 0;
  border-bottom: 1px solid rgba(0,0,0,0.06);
}

.kudo-row:last-child { border-bottom: none; }

.kudo-row .reaction { font-size: 1.2rem; margin-right: 0.5rem; }
.kudo-row .from { font-size: 0.85rem; color: var(--text-secondary); }
.kudo-row .comment { font-size: 0.9rem; margin-top: 0.25rem; }

/* Feed page: top-bar + nav sit fixed, the two panes below split the
   remaining viewport height and scroll independently of each other. */
.container.feed-layout {
  height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-bottom: 0;
  overflow: hidden;
}

.feed-layout .top-bar,
.feed-layout .app-nav {
  flex-shrink: 0;
}

.panes {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.pane {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 1rem;
}

/* Leave room so the fixed new-todo/new-plant buttons don't cover the
   last bit of scrolled content in the Done pane. */
.pane:last-child {
  padding-bottom: 4.5rem;
}

.pane + .pane {
  border-top: 1px solid rgba(0,0,0,0.08);
  padding-top: 0.75rem;
}

.pane-heading {
  position: sticky;
  top: 0;
  background: var(--bg);
  margin: 0 0 0.5rem;
  padding-bottom: 0.25rem;
  font-size: 1.1rem;
}

/* Quick reactions: feed-row gestures (static/reactions.js) */
.feed-row {
  touch-action: manipulation;
  -webkit-touch-callout: none;
  -webkit-user-select: none;
  user-select: none;
  transition: transform 0.15s ease;
}

.feed-row.pressing { transform: scale(0.98); }

.feed-row .reactions { display: inline-block; }

.gesture-hint {
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-secondary);
  margin: 0.25rem 0 1rem;
}

.reaction-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.18);
  z-index: 50;
  animation: fade-in 0.15s ease-out;
  touch-action: none;
}

.reaction-wheel-option {
  position: fixed;
  width: 52px;
  height: 52px;
  margin: -26px 0 0 -26px;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.7rem;
  z-index: 51;
  transition: transform 0.12s ease, box-shadow 0.12s ease;
  animation: wheel-in 0.22s cubic-bezier(0.34, 1.56, 0.64, 1) both;
  pointer-events: none;
}

.reaction-wheel-option.mine { box-shadow: 0 0 0 3px var(--accent), 0 4px 14px rgba(0, 0, 0, 0.18); }
.reaction-wheel-option.hover { transform: scale(1.45) translateY(-6px); }

.reaction-fx {
  position: fixed;
  left: 0;
  top: 0;
  font-size: 2rem;
  line-height: 1;
  pointer-events: none;
  z-index: 60;
  will-change: transform, opacity;
}

.feed-row.glow { animation: row-glow 0.9s ease-out; }

.reaction-picker {
  display: flex;
  gap: 0.5rem;
  flex-wrap: wrap;
  margin-bottom: 1rem;
}

.reaction-picker .reaction-choice {
  width: auto;
  padding: 0.45rem 0.7rem;
  font-size: 1.5rem;
  line-height: 1;
  background: var(--bg);
  border-radius: 999px;
  border: 2px solid transparent;
}

.reaction-picker .reaction-choice.selected { border-color: var(--accent); }

@keyframes fade-in { from { opacity: 0; } }

@keyframes wheel-in {
  from { opacity: 0; transform: scale(0.3); }
}

@keyframes row-glow {
  0% { box-shadow: 0 0 0 0 transparent; }
  25% { box-shadow: 0 0 0 3px var(--accent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
