*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at top, #ffffff 0, #f2f2f7 42%, #e5e5ea 100%);
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui,
    sans-serif;
  padding: 24px;
}

.hidden {
  display: none !important;
}

.phone-frame #detail-view.hidden {
  display: none !important;
}

.phone-frame {
  position: relative;
  width: min(420px, 100%);
  max-width: 100%;
  height: min(780px, 92vh);
  background: #f2f2f7;
  border-radius: 40px;
  box-shadow: 0 0 0 1px rgba(0, 0, 0, 0.06), 0 18px 40px rgba(0, 0, 0, 0.18);
  overflow: hidden;
  display: flex;
  flex-direction: column;
}

#list-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  height: 100%;
}

.phone-notch {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 180px;
  height: 30px;
  margin-top: 6px;
  border-radius: 20px;
  background: #000000;
}

.nav-bar {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 18px 10px;
  background: #fefef8;
  font-size: 13px;
  color: #fcbf2b;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.08);
  z-index: 100;
  overflow: visible;
}

.nav-title {
  font-weight: 700;
  color: #000;
  font-size: 17px;
}

.nav-subtitle {
  font-size: 13px;
  line-height: 1.4;
  color: #000;
  margin-top: 2px;
}

.nav-left {
  font-weight: 500;
  flex: 1;
}

.nav-right {
  letter-spacing: 2px;
}

.nav-menu {
  position: relative;
  display: flex;
  align-items: center;
  z-index: 100;
}

.nav-menu-trigger {
  letter-spacing: 2px;
  border: none;
  background: transparent;
  cursor: pointer;
  color: inherit;
  padding: 0;
  font-size: inherit;
  font-family: inherit;
}

.nav-menu-trigger:focus-visible {
  outline: none;
}

.nav-menu-dropdown {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  background: #ffffff;
  border-radius: 12px;
  box-shadow: 0 2px 16px rgba(0, 0, 0, 0.15), 0 0 0 0.5px rgba(0, 0, 0, 0.08);
  min-width: 240px;
  padding: 8px 0;
  display: none;
  z-index: 10000;
  overflow: hidden;
}

.nav-menu-dropdown.active {
  display: block;
}

.menu-item {
  display: flex;
  align-items: center;
  padding: 10px 16px;
  text-decoration: none;
  color: #000;
  font-size: 13px;
  line-height: 1.4;
  letter-spacing: normal;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  transition: background-color 0.1s;
  cursor: pointer;
}

.menu-item:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.menu-item:active {
  background-color: rgba(0, 0, 0, 0.1);
}

.menu-icon {
  display: inline-block;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  position: relative;
  opacity: 0.8;
}

.menu-text {
  flex: 1;
  color: #3a3a3c;
  letter-spacing: normal;
  font-weight: 400;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

/* Email icon - envelope */
.email-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 16px;
  height: 11px;
  border: 1.5px solid #5f6368;
  border-radius: 2px;
  box-sizing: border-box;
  background: transparent;
}

.email-icon::after {
  content: "";
  position: absolute;
  top: 3px;
  left: 2px;
  width: 16px;
  height: 6px;
  border-left: 1.5px solid #5f6368;
  border-top: 1.5px solid #5f6368;
  border-right: 1.5px solid #5f6368;
  border-bottom: none;
  border-radius: 2px 2px 0 0;
  box-sizing: border-box;
  background: transparent;
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}

/* Phone icon */
.phone-icon::before {
  content: "";
  position: absolute;
  top: 3px;
  left: 4px;
  width: 12px;
  height: 14px;
  border: 1.5px solid #5f6368;
  border-radius: 3px;
  box-sizing: border-box;
  background: transparent;
}

.phone-icon::after {
  content: "";
  position: absolute;
  top: 1px;
  left: 6px;
  width: 4px;
  height: 3px;
  border-radius: 0 0 2px 2px;
  background: #5f6368;
}

/* Instagram icon - camera */
.instagram-icon::before {
  content: "";
  position: absolute;
  top: 2px;
  left: 2px;
  width: 16px;
  height: 12px;
  border: 1.5px solid #5f6368;
  border-radius: 2px;
  box-sizing: border-box;
  background: transparent;
}

.instagram-icon::after {
  content: "";
  position: absolute;
  top: 5px;
  left: 9px;
  width: 4px;
  height: 4px;
  border: 1.5px solid #5f6368;
  border-radius: 50%;
  box-sizing: border-box;
  background: transparent;
}

.content {
  padding: 8px 12px 60px;
  background: #f2f2f7;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

/* Custom scrollbar styling */
.content::-webkit-scrollbar,
.note-detail::-webkit-scrollbar {
  width: 6px;
}

.content::-webkit-scrollbar-track,
.note-detail::-webkit-scrollbar-track {
  background: transparent;
}

.content::-webkit-scrollbar-thumb,
.note-detail::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.2);
  border-radius: 3px;
}

.content::-webkit-scrollbar-thumb:hover,
.note-detail::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.3);
}

/* Firefox scrollbar */
.content,
.note-detail {
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.2) transparent;
}

.search-row {
  padding: 4px 0 12px;
}

.search-field {
  background: #e5e5ea;
  border-radius: 10px;
  padding: 8px 10px;
  font-size: 13px;
  color: #8e8e93;
  display: flex;
  align-items: center;
  gap: 8px;
  position: relative;
}

.search-icon {
  display: inline-block;
  width: 14px;
  height: 14px;
  position: relative;
  flex-shrink: 0;
}

.search-icon::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  width: 10px;
  height: 10px;
  border: 1.5px solid #8e8e93;
  border-radius: 50%;
  box-sizing: border-box;
}

.search-icon::after {
  content: "";
  position: absolute;
  top: 8.5px;
  left: 8.5px;
  width: 5.5px;
  height: 1.5px;
  background: #8e8e93;
  transform: rotate(45deg);
  transform-origin: left center;
  border-radius: 1px;
}

.search-input {
  flex: 1;
  border: none;
  background: transparent;
  font-size: 13px;
  color: #000;
  outline: none;
  padding: 0;
}

.search-input::placeholder {
  color: #8e8e93;
}

.search-input:focus {
  color: #000;
}

.section-group {
  margin-bottom: 20px;
}

.section-heading {
  font-size: 15px;
  font-weight: 600;
  color: #6e6e73;
  margin: 6px 4px 6px;
}

.note-card {
  display: flex;
  align-items: stretch;
  padding: 10px 10px;
  border-radius: 12px;
  background: #ffffff;
  margin-bottom: 8px;
  box-shadow: 0 0 0 0.5px rgba(0, 0, 0, 0.04);
}

.note-card.pinned {
  background: #ff9500;
  color: #fff;
}

.note-card.pinned .note-main {
  color: #fff;
}

.note-icon.pin {
  display: none;
}

.note-icon.lock {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 4px;
  position: relative;
  vertical-align: middle;
  top: -1px;
}

.note-icon.lock::before {
  content: "";
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 6px;
  height: 4px;
  border-radius: 1px;
  background: #3a3a3c;
}

.note-icon.lock::after {
  content: "";
  position: absolute;
  bottom: 3px;
  left: 50%;
  transform: translateX(-50%);
  width: 5px;
  height: 5px;
  border-radius: 3px 3px 0 0;
  border: 1px solid #3a3a3c;
  border-bottom: 1px solid #3a3a3c;
  background: transparent;
  box-sizing: border-box;
}

.note-main {
  flex: 1;
  color: #000;
}

.note-title {
  font-size: 16px;
  font-weight: 600;
  margin-bottom: 2px;
}

.note-meta {
  font-size: 12px;
  color: #8e8e93;
  margin-bottom: 4px;
}

.note-card.pinned .note-meta {
  color: rgba(255, 255, 255, 0.8);
}

.note-preview {
  font-size: 13px;
  line-height: 1.4;
  color: #3a3a3c;
}

.note-card.pinned .note-preview {
  color: rgba(255, 255, 255, 0.95);
}

/* Detail view */

.phone-frame #detail-view {
  height: 100%;
  background: #ffffff;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

.nav-detail {
  justify-content: space-between;
}

#detail-folder-title {
  display: none;
}

.nav-back {
  border: none;
  background: none;
  padding: 4px 4px;
  margin-left: -4px;
  font-size: 15px;
  color: #fcbf2b;
  display: flex;
  align-items: center;
  gap: 2px;
}

.nav-back .chevron {
  font-size: 20px;
  margin-right: 2px;
}

.note-detail {
  background: #ffffff;
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}

.note-detail-inner {
  padding: 18px 18px 40px;
  text-align: left;
}

.note-detail-meta-top {
  font-size: 12px;
  color: #8e8e93;
  margin-bottom: 10px;
}

.note-detail-title {
  font-size: 26px;
  font-weight: 700;
  margin-bottom: 6px;
}

.note-detail-meta {
  font-size: 12px;
  color: #8e8e93;
  margin-bottom: 16px;
}

.note-detail-body {
  font-size: 15px;
  line-height: 1.5;
  color: #111;
  white-space: pre-line;
  text-align: left;
}

.note-detail-body > *:not(.note-image-container),
.note-detail-body p,
.note-detail-body ul,
.note-detail-body ol,
.note-detail-body li,
.note-detail-body strong,
.note-detail-body div:not(.note-image-container) {
  text-align: left;
}

.note-image-container {
  display: flex;
  justify-content: center;
  margin-top: 20px;
  text-align: center;
}

.note-image {
  max-width: 80%;
  height: auto;
  border-radius: 12px;
}

/* Locked note detail layout */

#detail-view.is-locked-note .note-detail-inner {
  height: calc(100% - 0px);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

#detail-view.is-locked-note .note-detail-meta-top,
#detail-view.is-locked-note .note-detail-meta {
  display: none;
}

#detail-view.is-locked-note .note-detail-title {
  font-size: 18px;
  margin-bottom: 24px;
}

#detail-view.is-locked-note .note-detail-body {
  white-space: normal;
  text-align: center;
}

/* Ensure unlocked notes are left-aligned */
#detail-view:not(.is-locked-note) .note-detail-inner {
  text-align: left !important;
}

#detail-view:not(.is-locked-note) .note-detail-body {
  text-align: left !important;
}

#detail-view:not(.is-locked-note) .note-detail-body > *:not(.note-image-container),
#detail-view:not(.is-locked-note) .note-detail-body ul,
#detail-view:not(.is-locked-note) .note-detail-body ol,
#detail-view:not(.is-locked-note) .note-detail-body li,
#detail-view:not(.is-locked-note) .note-detail-body strong,
#detail-view:not(.is-locked-note) .note-detail-body p,
#detail-view:not(.is-locked-note) .note-detail-body div:not(.note-image-container),
#detail-view:not(.is-locked-note) .note-detail-body span {
  text-align: left !important;
}

.locked-note-layout {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 18px;
}

.locked-note-icon {
  width: 72px;
  height: 72px;
  border-radius: 18px;
  background: #d1d1d6;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.locked-note-icon::before {
  content: "";
  width: 30px;
  height: 24px;
  border-radius: 6px;
  background: #8e8e93;
}

.locked-note-icon::after {
  content: "";
  position: absolute;
  top: 14px;
  width: 26px;
  height: 20px;
  border-radius: 13px 13px 0 0;
  border: 3px solid #8e8e93;
  border-bottom: none;
  background: transparent;
}

.locked-note-text {
  font-size: 16px;
  color: #3a3a3c;
}

.locked-note-button {
  border: none;
  border-radius: 999px;
  padding: 10px 28px;
  font-size: 15px;
  font-weight: 500;
  color: #fcbf2b;
  background: transparent;
  cursor: pointer;
}

.locked-note-button:hover {
  opacity: 0.8;
}

.password-input-container {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  width: 100%;
  max-width: 280px;
}

.password-input {
  width: 100%;
  padding: 12px 16px;
  font-size: 15px;
  border: 1px solid #d1d1d6;
  border-radius: 10px;
  background: #ffffff;
  color: #000;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.password-input:focus {
  outline: none;
  border-color: #fcbf2b;
}

.password-error {
  font-size: 14px;
  color: #ff3b30;
  margin-top: 4px;
}

/* Checklist styling for grocery list note */

.note-detail-body .note-intro {
  font-size: 15px;
  margin-bottom: 14px;
}

.checklist {
  list-style: none;
  padding-left: 0;
  text-align: left !important;
}

.checklist-item {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 13px;
  margin-bottom: 0px;
  line-height: 0.9;
  margin-top: -6px;
  text-align: left !important;
  justify-content: flex-start !important;
}

.check-bullet {
  width: 24px;
  height: 24px;
  border-radius: 50%;
  border: 2px solid #f4b503;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.checklist-item.checked .check-bullet {
  background-color: #f4b503;
  border-color: #f4b503;
}

.checklist-item.checked .check-bullet::before {
  content: "✓";
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

.check-text {
  flex: 1;
  text-align: left !important;
}

@media (max-width: 480px) {
  body {
    align-items: stretch;
    padding: 0;
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
  }

  .phone-frame {
    height: 100vh;
    height: 100dvh; /* Dynamic viewport height for mobile browsers */
    width: 100%;
    border-radius: 0;
    box-shadow: none;
    position: relative;
  }

  #list-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #list-view.hidden {
    display: none !important;
  }

  #detail-view {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    display: flex;
    flex-direction: column;
    overflow: hidden;
  }

  #detail-view.hidden {
    display: none !important;
  }

  .content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }

  .note-detail {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
    touch-action: pan-y;
  }
}

/* Work experience section */
.note-card[data-note-id="current-role"],
.note-card[data-note-id="previous-projects"] {
  background: #ffffff; /* White background like other notes */
}

/* CTA Card styling */
.note-card.cta-card {
  background: #ff9500; /* Orange like pinned */
  color: #fff;
  cursor: pointer;
  transition: transform 0.1s, box-shadow 0.1s;
}

.note-card.cta-card:active {
  transform: scale(0.98);
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.note-card.cta-card .note-main {
  color: #fff;
}

.note-card.cta-card .note-preview {
  color: rgba(255, 255, 255, 0.95);
}

/* Contact Form Modal */
.contact-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 10000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}

.contact-modal.hidden {
  display: none;
}

.contact-modal-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}

.contact-modal-content {
  position: relative;
  background: #ffffff;
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  max-height: 90vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
  z-index: 1;
}

.contact-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 20px 16px;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.1);
}

.contact-modal-title {
  font-size: 20px;
  font-weight: 700;
  color: #000;
  margin: 0;
}

.contact-modal-close {
  background: none;
  border: none;
  font-size: 32px;
  line-height: 1;
  color: #8e8e93;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 8px;
  transition: background-color 0.1s;
}

.contact-modal-close:hover {
  background-color: rgba(0, 0, 0, 0.05);
}

.contact-modal-close:active {
  background-color: rgba(0, 0, 0, 0.1);
}

.contact-form {
  padding: 20px;
}

.form-group {
  margin-bottom: 20px;
}

.form-label {
  display: block;
  font-size: 14px;
  font-weight: 600;
  color: #000;
  margin-bottom: 8px;
}

.form-input,
.form-textarea {
  width: 100%;
  padding: 10px 12px;
  font-size: 15px;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
  border: 1px solid #d1d1d6;
  border-radius: 8px;
  background: #ffffff;
  color: #000;
  box-sizing: border-box;
  transition: border-color 0.1s;
}

.form-input:focus,
.form-textarea:focus {
  outline: none;
  border-color: #ff9500;
}

.form-textarea {
  resize: vertical;
  min-height: 100px;
}

.form-submit {
  width: 100%;
  padding: 12px;
  font-size: 16px;
  font-weight: 600;
  color: #fff;
  background: #ff9500;
  border: none;
  border-radius: 10px;
  cursor: pointer;
  transition: background-color 0.1s, transform 0.1s;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", system-ui, sans-serif;
}

.form-submit:hover {
  background: #e68500;
}

.form-submit:active {
  transform: scale(0.98);
  background: #cc7500;
}

@media (max-width: 480px) {
  .contact-modal-content {
    max-width: 100%;
    border-radius: 16px 16px 0 0;
    max-height: 85vh;
  }

  .contact-modal {
    align-items: flex-end;
    padding: 0;
  }
}

/* Bottom bar */
#list-view {
  position: relative;
}

.bottom-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  background: #f2f2f7;
  border-top: 0.5px solid rgba(0, 0, 0, 0.08);
  z-index: 100;
  box-sizing: border-box;
}

.note-count {
  font-size: 13px;
  color: #000;
  font-weight: 400;
}

.content {
  padding-bottom: 60px;
}

