:root {
  color-scheme: light dark;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background: #f3f4f6;
  color: #111827;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  background: #f3f4f6;
}

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

.app-shell {
  width: min(880px, calc(100% - 32px));
  margin: 0 auto;
  padding: max(24px, env(safe-area-inset-top)) 0 max(40px, env(safe-area-inset-bottom));
}

.app-header {
  display: flex;
  gap: 20px;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 20px;
}

h1, h2, h3, p { margin-top: 0; }
h1 { margin-bottom: 8px; font-size: clamp(32px, 6vw, 52px); line-height: 1; }
h2 { margin-bottom: 16px; font-size: 22px; }
h3 { margin-bottom: 8px; font-size: 18px; }

.eyebrow {
  margin-bottom: 8px;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #4f46e5;
}

.subtitle, .muted { color: #6b7280; }
.subtitle { margin-bottom: 0; max-width: 650px; }

.card, .notice {
  background: #ffffff;
  border: 1px solid #e5e7eb;
  border-radius: 18px;
  box-shadow: 0 8px 30px rgba(17,24,39,.06);
}

.card { padding: 22px; margin-bottom: 18px; }
.notice { padding: 14px 16px; margin-bottom: 18px; }

form { display: grid; gap: 16px; }
label { display: grid; gap: 7px; font-weight: 650; }

input, textarea, select {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 12px;
  padding: 12px 14px;
  background: #fff;
  color: #111827;
  outline: none;
}

input:focus, textarea:focus, select:focus {
  border-color: #6366f1;
  box-shadow: 0 0 0 3px rgba(99,102,241,.14);
}

textarea { resize: vertical; min-height: 130px; }

button {
  border: 0;
  border-radius: 12px;
  padding: 11px 14px;
  cursor: pointer;
  font-weight: 700;
}

.primary { background: #111827; color: #fff; }
.secondary { background: #e5e7eb; color: #111827; }
.danger { background: #fee2e2; color: #991b1b; }

.status { min-height: 20px; margin-bottom: 0; font-size: 14px; color: #047857; }

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}
.section-heading h2 { margin-bottom: 4px; }
.section-heading p { margin-bottom: 0; }

.entries { display: grid; gap: 12px; }
.entry {
  border: 1px solid #e5e7eb;
  border-radius: 14px;
  padding: 16px;
  background: #f9fafb;
}
.entry-topline { display: flex; justify-content: space-between; gap: 12px; align-items: center; margin-bottom: 10px; }
.badge { display: inline-flex; border-radius: 999px; padding: 5px 9px; background: #eef2ff; color: #3730a3; font-size: 12px; font-weight: 800; }
time { font-size: 12px; color: #6b7280; }
.entry-content { white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.55; }
.delete-button { margin-top: 10px; }
.empty { margin-bottom: 0; color: #6b7280; }

@media (max-width: 640px) {
  .app-shell { width: min(100% - 20px, 880px); }
  .app-header, .section-heading { align-items: stretch; flex-direction: column; }
  .app-header button, .section-heading button { width: 100%; }
  .card { padding: 18px; }
}

@media (prefers-color-scheme: dark) {
  :root, body { background: #0b1020; color: #f3f4f6; }
  .card, .notice { background: #111827; border-color: #263144; }
  .subtitle, .muted, time, .empty { color: #9ca3af; }
  input, textarea, select { background: #0f172a; color: #f3f4f6; border-color: #374151; }
  .entry { background: #0f172a; border-color: #263144; }
  .secondary { background: #374151; color: #f9fafb; }
  .primary { background: #f9fafb; color: #111827; }
}

.install-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}
.install-card h2 { margin-bottom: 6px; }
.install-card p { margin-bottom: 0; }
.install-card button { min-width: 160px; }
.install-card button:disabled { opacity: .55; cursor: not-allowed; }
.install-help { margin-top: 8px !important; font-size: 14px; line-height: 1.45; }

@media (max-width: 640px) {
  .install-card { align-items: stretch; flex-direction: column; }
  .install-card button { width: 100%; }
}
