html {
  background: #fafafa;
}

body {
  background: #fafafa;
  color: #151515;
  font-family: Arial, sans-serif;
  margin: 32px;
}

[hidden] {
  display: none !important;
}

header {
  align-items: center;
  display: flex;
  gap: 16px;
  justify-content: space-between;
  min-height: 40px;
}

main {
  margin-top: 48px;
}

button {
  background: #151515;
  border: 0;
  border-radius: 6px;
  color: white;
  cursor: pointer;
  font: inherit;
  padding: 10px 14px;
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.55;
}

input,
textarea {
  background: white;
  border: 1px solid #d6d6d6;
  border-radius: 6px;
  box-sizing: border-box;
  color: #151515;
  font: inherit;
  width: 100%;
}

input:focus,
textarea:focus,
button:focus-visible {
  outline: 2px solid #4776e6;
  outline-offset: 2px;
}

html[data-session="cached"] #login-button {
  display: none;
}

.secondary-button {
  background: #ededed;
  color: #151515;
}

.danger-button {
  background: #fff1f1;
  color: #9d1c1c;
}

.profile {
  align-items: center;
  display: none;
  gap: 10px;
  min-height: 40px;
}

.profile[data-visible="true"] {
  display: flex;
}

.avatar {
  align-items: center;
  background: #ededed;
  border-radius: 999px;
  display: flex;
  height: 36px;
  justify-content: center;
  overflow: hidden;
  width: 36px;
}

.avatar img {
  height: 100%;
  object-fit: cover;
  width: 100%;
}

.signed-out-panel {
  max-width: 520px;
}

.signed-out-panel h1,
.section-heading h1 {
  font-size: 28px;
  line-height: 1.1;
  margin: 0;
}

.signed-out-panel p {
  color: #555;
  font-size: 18px;
  line-height: 1.5;
  margin: 14px 0 0;
}

.notes-app {
  align-items: stretch;
  display: grid;
  gap: 24px;
  grid-template-columns: minmax(220px, 320px) minmax(0, 1fr);
  min-height: min(680px, calc(100vh - 160px));
}

.notes-sidebar {
  border-right: 1px solid #e0e0e0;
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
  padding-right: 24px;
}

.section-heading,
.editor-actions {
  align-items: center;
  display: flex;
  gap: 12px;
  justify-content: space-between;
}

.status {
  color: #666;
  min-height: 22px;
}

.notes-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow: auto;
}

.note-list-button {
  background: transparent;
  border: 1px solid #dfdfdf;
  color: #151515;
  display: block;
  min-height: 76px;
  padding: 12px;
  text-align: left;
  width: 100%;
}

.note-list-button[aria-current="true"] {
  background: #f0f5ff;
  border-color: #9ab5ff;
}

.note-list-title {
  display: block;
  font-weight: 700;
  overflow-wrap: anywhere;
}

.note-list-excerpt {
  color: #666;
  display: block;
  font-size: 14px;
  line-height: 1.35;
  margin-top: 6px;
  overflow-wrap: anywhere;
}

.note-editor {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

#note-title {
  font-size: 28px;
  font-weight: 700;
  padding: 12px 14px;
}

#note-body {
  line-height: 1.5;
  min-height: 420px;
  padding: 14px;
  resize: vertical;
}

@media (max-width: 760px) {
  body {
    margin: 20px;
  }

  header,
  .profile {
    align-items: flex-start;
    flex-direction: column;
  }

  .notes-app {
    grid-template-columns: 1fr;
  }

  .notes-sidebar {
    border-right: 0;
    border-bottom: 1px solid #e0e0e0;
    padding: 0 0 20px;
  }
}
