:root {
  color-scheme: light;
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background: #f8fafc;
  color: #0f172a;
  font-synthesis: none;
  --bg-gradient: radial-gradient(circle at 50% 0%, #e0f2fe 0%, #f8fafc 70%);
  --card-bg: #ffffff;
  --card-border: #e2e8f0;
  --card-shadow: 0 10px 30px -5px rgba(15, 23, 42, 0.05), 0 4px 12px -2px rgba(15, 23, 42, 0.03);
  --text-main: #0f172a;
  --text-muted: #64748b;
  --primary-blue: #2563eb;
  --primary-blue-hover: #1d4ed8;
  --primary-shadow: 0 4px 14px rgba(37, 99, 235, 0.25);
  --success-color: #16a34a;
  --error-color: #dc2626;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg-gradient);
  color: var(--text-main);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

button, textarea, input { font: inherit; }
button { -webkit-tap-highlight-color: transparent; }

.app-shell {
  width: min(100%, 680px);
  margin: 0 auto;
  padding: calc(20px + env(safe-area-inset-top)) 18px calc(40px + env(safe-area-inset-bottom));
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 24px;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.brand-badge {
  font-family: 'Outfit', sans-serif;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.18em;
  color: var(--primary-blue);
  text-transform: uppercase;
}

h1, h2, p { margin-top: 0; }

h1 {
  margin-bottom: 0;
  font-family: 'Outfit', sans-serif;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: #0f172a;
}

h2 {
  margin-bottom: 6px;
  font-family: 'Outfit', sans-serif;
  font-size: 20px;
  font-weight: 600;
  color: #1e293b;
}

.status-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  border: 1px solid #cbd5e1;
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 500;
  background: #ffffff;
  color: #334155;
  box-shadow: 0 2px 6px rgba(0,0,0,0.04);
}

.status-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 2px rgba(34, 197, 94, 0.2);
}

.status-pill.syncing .status-dot {
  background: #3b82f6;
  animation: pulse 1.2s infinite;
}

@keyframes pulse {
  0% { opacity: 0.4; }
  50% { opacity: 1; }
  100% { opacity: 0.4; }
}

.capture-card, .recent-card {
  border: 1px solid var(--card-border);
  border-radius: 20px;
  background: var(--card-bg);
  box-shadow: var(--card-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.capture-card { padding: 22px; }
.recent-card { margin-top: 20px; padding: 20px; }

.hint {
  margin-bottom: 20px;
  color: var(--text-muted);
  line-height: 1.5;
  font-size: 14px;
}

.photo-button {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 68px;
  border: 2px dashed #93c5fd;
  border-radius: 16px;
  background: #f0f7ff;
  color: #1e40af;
  cursor: pointer;
  font-weight: 600;
  font-size: 15px;
  transition: all 0.2s ease;
}

.photo-button:hover {
  background: #e0f2fe;
  border-color: #3b82f6;
  transform: translateY(-1px);
}

.photo-button input { display: none; }

.camera-icon {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: linear-gradient(135deg, #3b82f6, #1d4ed8);
  color: #ffffff;
  font-size: 20px;
  font-weight: bold;
  line-height: 1;
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.3);
}

.preview {
  margin-top: 14px;
  overflow: hidden;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px;
}

.preview img {
  display: block;
  width: 100%;
  max-height: 320px;
  object-fit: contain;
  border-radius: 10px;
  background: #ffffff;
}

.file-preview {
  padding: 12px 14px;
  color: #334155;
  font-size: 14px;
  font-weight: 500;
}

.text-button {
  border: 0;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  font-weight: 500;
  padding: 8px 12px;
  border-radius: 8px;
  transition: all 0.15s ease;
}

.text-button:hover {
  color: #0f172a;
  background: #f1f5f9;
}

.sync-button {
  color: var(--primary-blue);
}
.sync-button:hover {
  background: #e0f2fe;
}

.preview .text-button { margin-top: 8px; }

.note-label {
  display: flex;
  justify-content: space-between;
  margin: 20px 0 8px;
  color: #1e293b;
  font-size: 14px;
  font-weight: 600;
}

.note-label span { color: var(--text-muted); font-weight: 400; font-size: 12px; }

textarea {
  width: 100%;
  resize: vertical;
  min-height: 110px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  padding: 14px;
  outline: none;
  background: #ffffff;
  color: #0f172a;
  line-height: 1.5;
  font-size: 15px;
  box-shadow: inset 0 1px 3px rgba(0,0,0,0.02);
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

textarea:focus {
  border-color: var(--primary-blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.15);
}

textarea::placeholder { color: #94a3b8; }

.save-button {
  width: 100%;
  min-height: 54px;
  margin-top: 16px;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  color: #ffffff;
  font-weight: 700;
  font-size: 16px;
  cursor: pointer;
  box-shadow: var(--primary-shadow);
  transition: all 0.2s ease;
}

.save-button:hover:not(:disabled) {
  background: linear-gradient(135deg, #1d4ed8, #1e40af);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(37, 99, 235, 0.35);
}

.save-button:active:not(:disabled) {
  transform: translateY(0);
}

.save-button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.save-message {
  min-height: 22px;
  margin: 12px 2px 0;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
}

.save-message.success { color: var(--success-color); }
.save-message.error { color: var(--error-color); }

.section-heading {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}

.heading-actions {
  display: flex;
  gap: 4px;
}

.capture-list { display: grid; gap: 10px; }

.capture-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 14px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  transition: border-color 0.15s ease;
}

.capture-row:hover {
  border-color: #cbd5e1;
}

.capture-row-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.capture-row strong {
  font-size: 14px;
  font-weight: 600;
  color: #0f172a;
  overflow-wrap: anywhere;
}

.capture-row-attachment {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: #0284c7;
  font-weight: 500;
}

.capture-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 4px;
  white-space: nowrap;
}

.capture-row time {
  color: var(--text-muted);
  font-size: 12px;
}

.sync-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  display: inline-flex;
  align-items: center;
  gap: 3px;
}

.sync-badge.synced {
  background: #dcfce7;
  color: #15803d;
}

.sync-badge.pending {
  background: #e0f2fe;
  color: #0369a1;
}

.empty-state {
  margin: 16px 0 8px;
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}

.muted { color: var(--text-muted); font-weight: 400; }

@media (min-width: 640px) {
  .app-shell { padding-top: 40px; }
}

