@import url('https://fonts.googleapis.com/css2?family=Lora:ital,wght@0,400;0,500;0,600;1,400&family=DM+Mono:wght@300;400;500&family=DM+Sans:wght@300;400;500;600&family=Space+Grotesk:wght@700&display=swap');

/* ─── Tokens ──────────────────────────────────────────────────────────── */
:root {
  --bg:        #FDFAF5;
  --bg-card:   #FFFFFF;
  --sand:      #F5ECD7;
  --sand-dark: #E8D9BC;
  --terra:     #C97B4B;
  --terra-d:   #A8622F;
  --sage:      #8B9E7A;
  --sage-l:    #B8CBA8;
  --ink:       #2C2416;
  --ink-l:     #6B5E4E;
  --ink-ll:    #A89880;
  --red:       #C94B4B;
  --yellow:    #C9A44B;
  --green:     #4B9E6B;

  --radius:    14px;
  --radius-sm: 8px;
  --shadow:    0 2px 12px rgba(44,36,22,.07);
  --shadow-lg: 0 8px 32px rgba(44,36,22,.12);
}

/* ─── Reset ───────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: 'DM Sans', sans-serif;
  background: var(--bg);
  color: var(--ink);
  min-height: 100dvh;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { cursor: pointer; border: none; background: none; font: inherit; }
input, textarea, select {
  font: inherit;
  color: inherit;
  background: none;
  border: none;
  outline: none;
}
img { display: block; max-width: 100%; }

/* ─── Layout ──────────────────────────────────────────────────────────── */
#app { min-height: 100dvh; display: flex; flex-direction: column; }

.page { flex: 1; padding: 0 0 6rem; animation: fadeIn .25s ease; }
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.container { max-width: 800px; margin: 0 auto; padding: 0 1.25rem; }

/* ─── Topbar ──────────────────────────────────────────────────────────── */
.topbar {
  position: sticky; top: 0; z-index: 100;
  background: rgba(253,250,245,.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--sand-dark);
  padding: 0 1rem 0 0;
  display: flex; align-items: center; gap: 0;
  min-height: 52px;
}

/* Brand link — the whole left cluster */
.topbar-brand {
  display: flex; align-items: center;
  flex: 1; gap: .875rem;
  text-decoration: none;
  min-width: 0;
}

/* Dark diagonal block */
.brand-block {
  background: #070709;
  display: flex; align-items: center;
  padding: 0 1.5rem 0 .875rem;
  height: 52px;
  clip-path: polygon(0 0, 100% 0, calc(100% - 18px) 100%, 0 100%);
  flex-shrink: 0;
}
.brand-mrln {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.03em;
  color: #e2e2f0;
  line-height: 1;
}
.brand-2003 {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: -.03em;
  line-height: 1;
  background: linear-gradient(135deg, #fff 20%, #a78bfa 60%, #2dd4bf);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* App name + date */
.brand-label {
  display: flex; flex-direction: column; gap: .05rem;
  min-width: 0;
}
.brand-app {
  font-family: 'DM Sans', sans-serif;
  font-size: .95rem;
  font-weight: 500;
  color: var(--ink);
  line-height: 1.2;
}
.brand-date {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  color: var(--ink-ll);
  letter-spacing: .04em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.topbar-actions { display: flex; gap: .25rem; padding-left: .5rem; }
.icon-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  display: grid; place-items: center;
  color: var(--ink-l);
  transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--sand); color: var(--ink); }
.icon-btn svg { width: 18px; height: 18px; }

/* ─── Bottom Nav ──────────────────────────────────────────────────────── */
.bottom-nav {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
  background: rgba(253,250,245,.95);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--sand-dark);
  display: flex;
  padding: .5rem 0 max(.5rem, env(safe-area-inset-bottom));
}
.nav-item {
  flex: 1; display: flex; flex-direction: column;
  align-items: center; gap: .2rem;
  padding: .35rem 0;
  color: var(--ink-ll);
  font-size: .65rem;
  font-family: 'DM Mono', monospace;
  letter-spacing: .04em;
  transition: color .15s;
}
.nav-item svg { width: 22px; height: 22px; }
.nav-item.active { color: var(--terra); }
.nav-item.active svg { stroke: var(--terra); }

/* ─── Friend Cards ────────────────────────────────────────────────────── */
.dashboard-header {
  padding: 1.75rem 0 1rem;
  display: flex; align-items: flex-end; justify-content: space-between;
}
.dashboard-header h1 {
  font-family: 'Lora', serif;
  font-size: 1.75rem;
  font-weight: 500;
  line-height: 1.1;
}
.dashboard-header h1 em {
  font-style: italic;
  color: var(--terra);
}
.dashboard-meta {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--ink-ll);
  letter-spacing: .04em;
  text-align: right;
}

.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
  gap: 1rem;
  padding-bottom: 1rem;
}

.friend-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  border: 1px solid var(--sand-dark);
  overflow: hidden;
  transition: box-shadow .2s, transform .15s;
  cursor: pointer;
}
.friend-card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.card-top {
  padding: 1rem 1rem .75rem;
  display: flex; align-items: center; gap: .875rem;
}
.avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--sand);
  object-fit: cover;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  color: var(--terra);
  overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.card-info { flex: 1; min-width: 0; }
.card-name {
  font-family: 'Lora', serif;
  font-size: 1.05rem;
  font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.card-tags {
  display: flex; flex-wrap: wrap; gap: .25rem;
  margin-top: .2rem;
}
.tag {
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  letter-spacing: .04em;
  background: var(--sand);
  color: var(--ink-l);
  padding: .1rem .45rem;
  border-radius: 99px;
}

.card-status {
  display: flex; gap: .5rem;
  padding: .6rem 1rem .875rem;
  flex-wrap: wrap;
}
.status-pill {
  display: flex; align-items: center; gap: .3rem;
  font-size: .7rem;
  padding: .25rem .6rem;
  border-radius: 99px;
  font-family: 'DM Mono', monospace;
  letter-spacing: .02em;
}
.status-pill .dot {
  width: 7px; height: 7px; border-radius: 50%;
  flex-shrink: 0;
}
.status-pill.ok     { background: #EFF7F2; color: var(--green); }
.status-pill.ok .dot      { background: var(--green); }
.status-pill.due_soon { background: #FBF4E5; color: var(--yellow); }
.status-pill.due_soon .dot { background: var(--yellow); }
.status-pill.overdue { background: #FBE9E9; color: var(--red); }
.status-pill.overdue .dot  { background: var(--red); }
.status-pill.never   { background: var(--sand); color: var(--ink-ll); }
.status-pill.never .dot    { background: var(--ink-ll); }

.card-birthday {
  padding: .35rem 1rem .7rem;
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--terra);
  letter-spacing: .03em;
}

/* ─── FAB ─────────────────────────────────────────────────────────────── */
.fab {
  position: fixed; bottom: 5.5rem; right: 1.25rem; z-index: 90;
  width: 52px; height: 52px;
  background: var(--terra);
  color: #fff;
  border-radius: 50%;
  box-shadow: 0 4px 16px rgba(201,123,75,.4);
  display: grid; place-items: center;
  transition: background .15s, transform .15s, box-shadow .15s;
}
.fab:hover { background: var(--terra-d); transform: scale(1.06); box-shadow: 0 6px 20px rgba(201,123,75,.5); }
.fab svg { width: 22px; height: 22px; }

/* ─── Friend Detail Page ──────────────────────────────────────────────── */
.friend-header {
  background: linear-gradient(160deg, var(--sand) 0%, var(--bg) 100%);
  padding: 1.5rem 1.25rem 1.25rem;
  position: relative;
}
.back-btn {
  display: inline-flex; align-items: center; gap: .35rem;
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  color: var(--ink-ll);
  letter-spacing: .04em;
  margin-bottom: .75rem;
  transition: color .15s;
}
.back-btn:hover { color: var(--terra); }
.back-btn svg { width: 14px; height: 14px; }

.friend-profile {
  display: flex; align-items: center; gap: 1.25rem;
}
.friend-avatar-lg {
  width: 80px; height: 80px;
  border-radius: 50%;
  background: var(--sand-dark);
  object-fit: cover;
  flex-shrink: 0;
  display: grid; place-items: center;
  font-family: 'Lora', serif;
  font-size: 2rem;
  color: var(--terra);
  overflow: hidden;
  border: 3px solid var(--bg-card);
  box-shadow: var(--shadow);
}
.friend-avatar-lg img { width: 100%; height: 100%; object-fit: cover; }
.friend-profile-info { flex: 1; }
.friend-profile-name {
  font-family: 'Lora', serif;
  font-size: 1.6rem;
  font-weight: 500;
  line-height: 1.1;
}
.friend-profile-meta {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--ink-ll);
  letter-spacing: .04em;
  margin-top: .25rem;
}

.section {
  padding: 1.25rem 1.25rem 0;
}
.section-label {
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-ll);
  margin-bottom: .75rem;
}
.section-label::before { content: '/* '; }
.section-label::after  { content: ' */'; }

.contact-types-list { display: flex; flex-direction: column; gap: .5rem; }
.contact-type-row {
  background: var(--bg-card);
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius-sm);
  padding: .75rem 1rem;
  display: flex; align-items: center; gap: .75rem;
}
.ct-icon {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--sand);
  display: grid; place-items: center;
  font-size: 1rem;
  flex-shrink: 0;
}
.ct-info { flex: 1; min-width: 0; }
.ct-label {
  font-weight: 500;
  font-size: .9rem;
}
.ct-meta {
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  color: var(--ink-ll);
  letter-spacing: .03em;
  margin-top: .1rem;
}
.ct-log-btn {
  background: var(--terra);
  color: #fff;
  border-radius: var(--radius-sm);
  padding: .35rem .75rem;
  font-size: .8rem;
  font-weight: 500;
  transition: background .15s;
  white-space: nowrap;
}
.ct-log-btn:hover { background: var(--terra-d); }

/* ─── Calendar View ───────────────────────────────────────────────────── */
.calendar-section { margin-top: 1.5rem; }
.calendar-type { margin-bottom: 1.5rem; }
.calendar-type-label {
  display: flex; align-items: center; gap: .5rem;
  font-size: .8rem; font-weight: 500;
  margin-bottom: .6rem;
}
.calendar-grid {
  display: flex;
  gap: 2px;
  overflow-x: auto;
  padding-bottom: .25rem;
}
.calendar-week { display: flex; flex-direction: column; gap: 2px; }
.calendar-day {
  width: 13px; height: 13px;
  border-radius: 3px;
  background: var(--sand);
  transition: background .1s;
  position: relative;
  cursor: default;
}
.calendar-day.has-log { background: var(--terra); }
.calendar-day.has-log:hover::after {
  content: attr(data-tooltip);
  position: absolute; bottom: calc(100% + 4px); left: 50%;
  transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: .6rem;
  padding: .25rem .5rem;
  border-radius: 4px;
  white-space: nowrap;
  pointer-events: none;
  z-index: 10;
}
.calendar-months {
  display: flex;
  gap: 2px;
  margin-bottom: .3rem;
  overflow: hidden;
}
.calendar-month-label {
  font-family: 'DM Mono', monospace;
  font-size: .58rem;
  color: var(--ink-ll);
  letter-spacing: .04em;
  min-width: 0;
  flex: 1;
  text-align: left;
}

/* ─── Log History ─────────────────────────────────────────────────────── */
.log-list { display: flex; flex-direction: column; gap: .5rem; margin-top: .75rem; }
.log-item {
  display: flex; align-items: flex-start; gap: .75rem;
  padding: .75rem 0;
  border-bottom: 1px solid var(--sand);
}
.log-item:last-child { border-bottom: none; }
.log-date {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--ink-ll);
  letter-spacing: .04em;
  white-space: nowrap;
  margin-top: .1rem;
  min-width: 72px;
}
.log-content { flex: 1; }
.log-type {
  font-size: .75rem;
  font-weight: 500;
  color: var(--terra);
}
.log-note {
  font-size: .85rem;
  color: var(--ink-l);
  margin-top: .15rem;
}
.log-delete {
  color: var(--ink-ll);
  padding: .2rem;
  border-radius: 4px;
  transition: color .15s;
  opacity: 0;
  transition: opacity .15s;
}
.log-item:hover .log-delete { opacity: 1; }
.log-delete:hover { color: var(--red); }
.log-delete svg { width: 14px; height: 14px; }

/* ─── Log Dialog ──────────────────────────────────────────────────────── */
.modal-overlay {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(44,36,22,.4);
  backdrop-filter: blur(4px);
  display: flex; align-items: flex-end; justify-content: center;
  animation: overlayIn .2s ease;
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
@media (min-width: 600px) {
  .modal-overlay { align-items: center; }
}

.modal {
  background: var(--bg-card);
  border-radius: var(--radius) var(--radius) 0 0;
  padding: 1.5rem 1.25rem 2.5rem;
  width: 100%;
  max-width: 480px;
  animation: slideUp .25s cubic-bezier(.22,.68,0,1.2);
}
@media (min-width: 600px) {
  .modal { border-radius: var(--radius); padding-bottom: 1.5rem; }
}
@keyframes slideUp { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }

.modal-drag {
  width: 36px; height: 4px;
  background: var(--sand-dark);
  border-radius: 99px;
  margin: 0 auto 1.25rem;
}
@media (min-width: 600px) { .modal-drag { display: none; } }

.modal h2 {
  font-family: 'Lora', serif;
  font-size: 1.25rem;
  font-weight: 500;
  margin-bottom: 1.25rem;
}

.type-selector {
  display: flex; gap: .5rem; flex-wrap: wrap;
  margin-bottom: 1rem;
}
.type-chip {
  display: flex; align-items: center; gap: .35rem;
  padding: .45rem .85rem;
  border-radius: 99px;
  border: 1.5px solid var(--sand-dark);
  font-size: .8rem;
  background: var(--bg);
  transition: border-color .15s, background .15s, color .15s;
  cursor: pointer;
}
.type-chip.selected {
  border-color: var(--terra);
  background: #FDF0E7;
  color: var(--terra);
}

.form-field { margin-bottom: 1rem; }
.form-label {
  display: block;
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  letter-spacing: .08em;
  color: var(--ink-ll);
  margin-bottom: .4rem;
}
.form-input {
  width: 100%;
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: .65rem .875rem;
  font-size: .9rem;
  border: 1.5px solid transparent;
  transition: border-color .15s;
}
.form-input:focus { border-color: var(--terra); }

.form-actions {
  display: flex; gap: .75rem;
  margin-top: 1.25rem;
}
.btn {
  flex: 1;
  padding: .75rem;
  border-radius: var(--radius-sm);
  font-size: .9rem;
  font-weight: 500;
  transition: background .15s, opacity .15s;
  text-align: center;
}
.btn-primary { background: var(--terra); color: #fff; }
.btn-primary:hover { background: var(--terra-d); }
.btn-secondary { background: var(--sand); color: var(--ink-l); }
.btn-secondary:hover { background: var(--sand-dark); }
.btn:disabled { opacity: .5; pointer-events: none; }

/* ─── Friend Edit Form ────────────────────────────────────────────────── */
.edit-page { max-width: 600px; margin: 0 auto; padding: 1.5rem 1.25rem 6rem; }
.edit-page h1 {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin: .75rem 0 1.5rem;
}

.avatar-upload {
  display: flex; align-items: center; gap: 1rem;
  margin-bottom: 1.5rem;
}
.avatar-preview {
  width: 64px; height: 64px;
  border-radius: 50%;
  background: var(--sand);
  object-fit: cover;
  display: grid; place-items: center;
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  color: var(--terra);
  overflow: hidden;
}
.avatar-preview img { width: 100%; height: 100%; object-fit: cover; }
.upload-btn {
  background: var(--sand);
  padding: .5rem 1rem;
  border-radius: var(--radius-sm);
  font-size: .85rem;
  cursor: pointer;
  transition: background .15s;
}
.upload-btn:hover { background: var(--sand-dark); }

.contact-types-editor { margin-top: .75rem; }
.ct-edit-row {
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: .75rem;
  margin-bottom: .5rem;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: .5rem;
  align-items: center;
}
.ct-edit-row select, .ct-edit-row input[type=text] {
  background: var(--bg-card);
  border-radius: 6px;
  padding: .35rem .6rem;
  font-size: .85rem;
  border: 1.5px solid transparent;
}
.ct-edit-row select:focus, .ct-edit-row input:focus { border-color: var(--terra); }
.ct-interval { display: flex; align-items: center; gap: .4rem; }
.ct-interval input[type=number] {
  background: var(--bg-card);
  border-radius: 6px;
  padding: .35rem .5rem;
  font-size: .85rem;
  width: 60px;
  text-align: center;
  border: 1.5px solid transparent;
}
.ct-interval input:focus { border-color: var(--terra); }
.ct-interval span {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--ink-ll);
}
.add-ct-btn {
  display: flex; align-items: center; gap: .4rem;
  font-size: .85rem;
  color: var(--terra);
  padding: .5rem 0;
  transition: opacity .15s;
}
.add-ct-btn:hover { opacity: .75; }
.add-ct-btn svg { width: 16px; height: 16px; }
.remove-btn { color: var(--ink-ll); transition: color .15s; }
.remove-btn:hover { color: var(--red); }
.remove-btn svg { width: 16px; height: 16px; }
.toggle-btn {
  width: 36px; height: 20px;
  border-radius: 99px;
  background: var(--sand-dark);
  position: relative;
  transition: background .2s;
  flex-shrink: 0;
}
.toggle-btn.on { background: var(--terra); }
.toggle-btn::after {
  content: '';
  position: absolute;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: #fff;
  top: 2px; left: 2px;
  transition: transform .2s;
  box-shadow: 0 1px 3px rgba(0,0,0,.2);
}
.toggle-btn.on::after { transform: translateX(16px); }

.tags-input {
  display: flex; flex-wrap: wrap; gap: .4rem;
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: .5rem .875rem;
  border: 1.5px solid transparent;
  min-height: 44px;
  align-items: center;
  cursor: text;
  transition: border-color .15s;
}
.tags-input.focused { border-color: var(--terra); }
.tags-input .tag-badge {
  background: var(--terra);
  color: #fff;
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  padding: .15rem .5rem;
  border-radius: 99px;
  display: flex; align-items: center; gap: .3rem;
  cursor: pointer;
}
.tags-input input {
  flex: 1; min-width: 80px;
  font-size: .85rem;
  background: none;
}

/* ─── Login ───────────────────────────────────────────────────────────── */
.login-page {
  min-height: 100dvh;
  display: flex; align-items: center; justify-content: center;
  padding: 1.5rem;
  background: linear-gradient(160deg, var(--sand) 0%, var(--bg) 60%);
}
.login-box {
  width: 100%; max-width: 380px;
}
.login-logo {
  display: flex; align-items: center; gap: .75rem;
  margin-bottom: .35rem;
}
.login-brand-block {
  height: 44px;
  padding: 0 1.2rem 0 .75rem;
  font-size: .95rem;
}
.login-logo-app {
  font-family: 'Lora', serif;
  font-size: 2rem;
  font-weight: 500;
  color: var(--terra);
  line-height: 1;
}
.login-sub {
  font-family: 'DM Mono', monospace;
  font-size: .65rem;
  color: var(--ink-ll);
  letter-spacing: .08em;
  margin-bottom: 2rem;
}
.login-form { display: flex; flex-direction: column; gap: .75rem; }
.login-toggle {
  font-family: 'DM Mono', monospace;
  font-size: .7rem;
  color: var(--ink-ll);
  text-align: center;
  margin-top: .5rem;
  cursor: pointer;
  transition: color .15s;
}
.login-toggle span { color: var(--terra); }
.login-toggle:hover span { text-decoration: underline; }
.login-error {
  background: #FBE9E9;
  color: var(--red);
  border-radius: var(--radius-sm);
  padding: .6rem .875rem;
  font-size: .8rem;
  display: none;
}
.login-error.visible { display: block; }

/* ─── Settings ────────────────────────────────────────────────────────── */
.settings-page { max-width: 540px; margin: 0 auto; padding: 1.5rem 1.25rem 6rem; }
.settings-page h1 {
  font-family: 'Lora', serif;
  font-size: 1.5rem;
  font-weight: 500;
  margin: .75rem 0 1.5rem;
}
.settings-section { margin-bottom: 2rem; }
.settings-card {
  background: var(--bg-card);
  border: 1px solid var(--sand-dark);
  border-radius: var(--radius);
  overflow: hidden;
}
.settings-row {
  display: flex; align-items: center; gap .75rem;
  padding: 1rem;
  border-bottom: 1px solid var(--sand);
}
.settings-row:last-child { border-bottom: none; }
.settings-row-info { flex: 1; }
.settings-row-label { font-weight: 500; font-size: .9rem; }
.settings-row-desc {
  font-family: 'DM Mono', monospace;
  font-size: .62rem;
  color: var(--ink-ll);
  letter-spacing: .03em;
  margin-top: .15rem;
}
.settings-row-action { margin-left: auto; }

/* ─── Empty State ─────────────────────────────────────────────────────── */
.empty-state {
  text-align: center;
  padding: 4rem 1.5rem;
  color: var(--ink-ll);
}
.empty-state-icon {
  font-size: 3rem;
  margin-bottom: 1rem;
  opacity: .5;
}
.empty-state h3 {
  font-family: 'Lora', serif;
  font-size: 1.2rem;
  font-weight: 500;
  color: var(--ink);
  margin-bottom: .5rem;
}
.empty-state p {
  font-size: .85rem;
  max-width: 280px;
  margin: 0 auto 1.5rem;
  line-height: 1.6;
}

/* ─── Notes ───────────────────────────────────────────────────────────── */
.friend-notes {
  font-size: .875rem;
  color: var(--ink-l);
  line-height: 1.6;
  background: var(--sand);
  border-radius: var(--radius-sm);
  padding: .875rem 1rem;
  white-space: pre-wrap;
}

/* ─── Toast ───────────────────────────────────────────────────────────── */
.toast {
  position: fixed; bottom: 5.5rem; left: 50%; transform: translateX(-50%);
  background: var(--ink);
  color: #fff;
  padding: .65rem 1.25rem;
  border-radius: 99px;
  font-size: .85rem;
  z-index: 300;
  animation: toastIn .2s ease, toastOut .2s ease 2.3s forwards;
  pointer-events: none;
}
@keyframes toastIn { from { opacity: 0; transform: translateX(-50%) translateY(8px); } to { opacity: 1; transform: translateX(-50%); } }
@keyframes toastOut { to { opacity: 0; transform: translateX(-50%) translateY(4px); } }

/* ─── Loader ──────────────────────────────────────────────────────────── */
.loader {
  display: flex; align-items: center; justify-content: center;
  padding: 3rem;
}
.spinner {
  width: 28px; height: 28px;
  border: 2.5px solid var(--sand-dark);
  border-top-color: var(--terra);
  border-radius: 50%;
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ─── Responsive ──────────────────────────────────────────────────────── */
@media (max-width: 480px) {
  .cards-grid { grid-template-columns: 1fr; }
  .friend-profile-name { font-size: 1.35rem; }
}

/* ─── Scrollbar ───────────────────────────────────────────────────────── */
::-webkit-scrollbar { width: 5px; height: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: var(--sand-dark); border-radius: 99px; }
