:root {
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  color: #0f172a;
  background:
    radial-gradient(circle at top left, rgba(250, 204, 21, 0.35), transparent 28%),
    linear-gradient(160deg, #fff8eb 0%, #f8fafc 45%, #e2e8f0 100%);
}

* {
  box-sizing: border-box;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

.page {
  width: min(960px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 2rem 0 4rem;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 1rem 0 2rem;
}

.brand {
  font-size: 1.1rem;
  font-weight: 700;
  text-decoration: none;
  color: #0f172a;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  gap: 1rem;
  align-items: center;
}

.nav a {
  color: #334155;
  text-decoration: none;
  font-weight: 600;
}

.nav-logout-form {
  margin: 0;
}

.nav-button {
  padding: 0;
  border: none;
  background: transparent;
  color: #334155;
  font: inherit;
  font-weight: 600;
}

.nav-button:hover {
  text-decoration: underline;
}

.panel {
  background: rgba(255, 255, 255, 0.84);
  backdrop-filter: blur(10px);
  border: 1px solid rgba(148, 163, 184, 0.25);
  border-radius: 1.5rem;
  padding: 2rem;
  box-shadow: 0 18px 60px rgba(15, 23, 42, 0.10);
}

.hero h1,
.stack h1 {
  margin: 0.25rem 0 1rem;
  font-size: clamp(2.5rem, 7vw, 4.75rem);
  line-height: 0.95;
}

.eyebrow {
  margin: 0;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.8rem;
  color: #b45309;
  font-weight: 700;
}

.lead {
  max-width: 42rem;
  font-size: 1.1rem;
  line-height: 1.8;
  color: #334155;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin-top: 2rem;
}

.button,
button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 999px;
  background: #0f172a;
  color: #fff;
  padding: 0.9rem 1.3rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
}

.button-secondary {
  background: #e2e8f0;
  color: #0f172a;
}

.stack {
  display: grid;
  gap: 1.75rem;
}

.note-form {
  display: grid;
  gap: 0.75rem;
}

label {
  font-weight: 700;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 1rem;
  padding: 0.9rem 1rem;
  font: inherit;
  background: rgba(255, 255, 255, 0.92);
}

input[type="file"] {
  padding: 0.75rem 0.9rem;
}

textarea {
  resize: vertical;
}

.field-help {
  margin: -0.2rem 0 0.4rem;
  color: #64748b;
  line-height: 1.5;
}

.auth-stack {
  max-width: 32rem;
}

.auth-form {
  gap: 0.9rem;
}

.auth-error {
  margin: 0;
  padding: 0.9rem 1rem;
  border-radius: 1rem;
  background: #fef3f2;
  color: #b42318;
  border: 1px solid #fecdca;
  font-weight: 700;
}

.notes-list h2 {
  margin-bottom: 1rem;
}

.notes-search {
  display: grid;
  gap: 0.85rem;
}

.notes-search-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

.notes-summary {
  margin: 0.35rem 0 0;
  color: #64748b;
  line-height: 1.6;
}

.search-form {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.search-form input {
  flex: 1 1 18rem;
}

.search-form select {
  flex: 0 0 12rem;
}

.search-clear {
  color: #0f172a;
  font-weight: 700;
  text-decoration: none;
}

.notes-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}

.note-card {
  padding: 1.2rem;
  border-radius: 1.2rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 0.9rem;
}

.note-card h3 {
  margin: 0.3rem 0 0.7rem;
}

.note-title-link {
  color: inherit;
  text-decoration: none;
}

.note-title-link:hover {
  text-decoration: underline;
}

.note-card-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1rem;
}

.note-card p,
.note-meta,
.empty-state {
  color: #475569;
  line-height: 1.7;
}

.note-card p {
  white-space: pre-wrap;
}

.note-thumb-link {
  display: block;
}

.note-thumb {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.note-meta {
  font-size: 0.9rem;
  font-weight: 700;
}

.note-timestamps {
  display: grid;
  gap: 0.2rem;
  color: #64748b;
  font-size: 0.88rem;
  line-height: 1.5;
}

.note-timestamps-edit {
  margin-top: 0.8rem;
}

.note-detail-card {
  padding: 1.4rem;
  border-radius: 1.25rem;
  background: linear-gradient(180deg, #ffffff, #f8fafc);
  border: 1px solid #e2e8f0;
  display: grid;
  gap: 1rem;
}

.current-image-preview {
  display: grid;
  gap: 0.75rem;
}

.form-image-preview {
  width: 100%;
  max-width: min(100%, 22rem);
  height: auto;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.note-detail-image {
  width: 100%;
  max-height: 32rem;
  height: auto;
  object-fit: cover;
  border-radius: 1rem;
  border: 1px solid #e2e8f0;
  background: #f8fafc;
}

.note-detail-body {
  margin: 0;
  color: #334155;
  line-height: 1.8;
  white-space: pre-wrap;
}

.note-actions,
.form-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.note-actions form {
  margin: 0;
}

.button-small {
  padding: 0.65rem 1rem;
  font-size: 0.95rem;
}

.button-danger {
  background: #b42318;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
}

.pagination-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
}

.pagination-link {
  min-width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.75rem;
  border-radius: 999px;
  border: 1px solid #cbd5e1;
  color: #0f172a;
  text-decoration: none;
  font-weight: 700;
  background: rgba(255, 255, 255, 0.92);
}

.pagination-link-current {
  background: #0f172a;
  color: #fff;
  border-color: #0f172a;
}

.pagination-gap {
  min-width: 2.5rem;
  height: 2.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #64748b;
  font-weight: 700;
}

code {
  padding: 0.12rem 0.35rem;
  border-radius: 0.35rem;
  background: rgba(15, 23, 42, 0.08);
}

@media (max-width: 640px) {
  .page {
    width: min(100%, calc(100% - 1rem));
    padding-top: 1rem;
  }

  .panel {
    padding: 1.25rem;
  }

  .topbar {
    flex-direction: column;
    gap: 0.75rem;
    align-items: flex-start;
  }

  .notes-search-header {
    flex-direction: column;
    align-items: flex-start;
  }

  .note-card-header {
    flex-direction: column;
  }
}
