:root {
  --bg: #fff9ed;
  --ink: #0f0c08;
  --muted: #4a443c;
  --card: rgba(0, 0, 0, 0.04);
  --stroke: rgba(0, 0, 0, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: "Neue Haas Unica", sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100vh;
  display: flex;
  justify-content: center;
}

.app-shell {
  width: 100%;
  max-width: 720px;
  padding: 2.5rem 1.25rem 6rem;
}

.app-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.notes-cta {
  display: flex;
  justify-content: center;
  margin-bottom: 1.75rem;
}

.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.2em;
  font-size: 0.75rem;
  margin: 0 0 0.35rem;
}

h1 {
  margin: 0;
  font-size: clamp(1.8rem, 4vw, 2.4rem);
  line-height: 1.2;
}

button {
  font-family: inherit;
  cursor: pointer;
}

.primary-cta {
  background: var(--ink);
  color: var(--bg);
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.8rem;
  font-size: 1rem;
  white-space: nowrap;
  transition: transform 120ms ease, box-shadow 120ms ease;
}

.primary-cta:hover,
.primary-cta:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.18);
}

.primary-cta.full {
  width: 100%;
  margin-top: 1rem;
}

.notes {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.note-card {
  background: rgba(255, 255, 255, 0.6);
  border: 1px solid var(--stroke);
  border-radius: 0.85rem;
  padding: 1.25rem;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.07);
  position: relative;
  cursor: pointer;
  transition: transform 140ms ease, box-shadow 140ms ease;
}

.note-card:focus-within,
.note-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.12);
}

.note-meta {
  display: flex;
  justify-content: space-between;
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.note-body {
  white-space: pre-wrap;
  line-height: 1.45;
  margin-bottom: 0.75rem;
  display: -webkit-box;
  -webkit-line-clamp: 4;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.note-body.full {
  display: block;
  -webkit-line-clamp: unset;
}

.note-actions {
  text-align: right;
}

.delete-btn {
  background: transparent;
  border: 1px solid var(--stroke);
  border-radius: 999px;
  color: var(--muted);
  font-size: 0.8rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  padding: 0.35rem 0.9rem;
  transition: background 140ms ease, color 140ms ease;
}

.delete-btn:hover,
.delete-btn:focus-visible {
  background: rgba(0, 0, 0, 0.08);
  color: var(--ink);
}

.empty-state {
  text-align: center;
  color: var(--muted);
  margin-top: 3rem;
}

.hidden {
  display: none !important;
}

.composer {
  position: fixed;
  inset: 0;
  background: rgba(15, 12, 8, 0.45);
  display: flex;
  justify-content: center;
  align-items: flex-end;
  padding: 1.5rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease;
}

.composer.open {
  opacity: 1;
  pointer-events: all;
}

.composer-card {
  width: 100%;
  max-width: 640px;
  background: var(--bg);
  border-radius: 0.85rem 0.85rem 0 0;
  padding: 1.5rem;
  box-shadow: 0 -20px 40px rgba(0, 0, 0, 0.18);
}

.composer-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.75rem;
  margin-bottom: 1rem;
}

.composer-header > :first-child {
  flex: 1;
}

.composer-header .ghost-btn {
  padding: 0.2rem 0.4rem;
}

.field {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
  margin-bottom: 1rem;
  font-size: 0.95rem;
}

.field-label {
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

textarea {
  resize: vertical;
  min-height: 140px;
  border-radius: 0.85rem;
  border: 1px solid var(--stroke);
  padding: 1rem;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.85);
}

.draft-row {
  display: flex;
  justify-content: flex-end;
}

.ghost-btn {
  background: transparent;
  border: none;
  color: var(--muted);
}

.ghost-btn.small {
  font-size: 0.8rem;
}

.composer.note-detail {
  align-items: center;
  padding: 2rem 1.25rem;
}

.note-detail .composer-card {
  max-height: 90vh;
  overflow-y: auto;
  border-radius: 0.85rem;
  padding: 1.75rem;
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.25);
}

.note-detail-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.detail-actions {
  margin-top: 1rem;
}

.password-lock {
  position: fixed;
  inset: 0;
  background: var(--bg);
  display: flex;
  justify-content: center;
  align-items: center;
  padding: 1.5rem;
  z-index: 1000;
}

.password-lock.hidden {
  display: none;
}

.password-card {
  width: 100%;
  max-width: 400px;
  background: rgba(255, 255, 255, 0.8);
  border: 1px solid var(--stroke);
  border-radius: 0.85rem;
  padding: 2rem;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.12);
}

.password-header {
  text-align: center;
  margin-bottom: 1.5rem;
}

.password-header h2 {
  margin: 0;
  font-size: 1.5rem;
}

.password-hint {
  font-size: 0.85rem;
  color: #c53030;
  margin-top: 0.5rem;
}

input[type="password"],
input[type="text"] {
  width: 100%;
  border-radius: 0.85rem;
  border: 1px solid var(--stroke);
  padding: 0.8rem 1rem;
  font-family: inherit;
  font-size: 1rem;
  background: rgba(255, 255, 255, 0.85);
}

input[type="password"]:focus,
input[type="text"]:focus {
  outline: none;
  border-color: var(--ink);
}

.settings-content {
  display: flex;
  flex-direction: column;
  gap: 2rem;
  max-height: 70vh;
  overflow-y: auto;
}

.settings-section {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.settings-section h3 {
  margin: 0;
  font-size: 1.1rem;
}

.settings-description {
  font-size: 0.9rem;
  color: var(--muted);
  margin: 0;
}

.settings-status {
  min-height: 1.5rem;
}

.sync-status {
  font-size: 0.85rem;
  margin: 0;
}

.sync-status.success {
  color: #38a169;
}

.sync-status.error {
  color: #c53030;
}

.settings-actions {
  display: flex;
  gap: 0.75rem;
  flex-wrap: wrap;
}

@media (min-width: 768px) {
  .app-shell {
    padding-bottom: 3rem;
  }

  .composer-card {
    border-radius: 0.85rem;
    margin-bottom: 2rem;
  }
}
