    :root {
      --ink: #39202d;
      --muted: #806170;
      --paper: #fffafd;
      --canvas: #ffedf4;
      --line: #efd4e0;
      --wine: #ad2f63;
      --wine-dark: #74193f;
      --wine-soft: #fde3ee;
      --sage: #9a5270;
      --sage-soft: #f6e2eb;
      --sun: #d687a4;
      --shadow: 0 18px 52px rgba(111, 35, 70, 0.14);
      --radius: 22px;
    }

    * { box-sizing: border-box; }

    html { scroll-behavior: smooth; }

    body {
      min-width: 320px;
      margin: 0;
      color: var(--ink);
      min-height: 100vh;
      background:
        radial-gradient(circle at 8% 5%, rgba(255, 255, 255, 0.88) 0, transparent 28%),
        radial-gradient(circle at 94% 92%, rgba(255, 221, 234, 0.92) 0, transparent 35%),
        linear-gradient(135deg, #f9d3e1 0%, #ef9db9 52%, #d87198 100%);
      position: relative;
      -webkit-font-smoothing: antialiased;
      -moz-osx-font-smoothing: grayscale;
      font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    }

    /* Translucent iOS-like overlay (subtle for readability) */
    body::before {
      content: "";
      position: fixed;
      inset: 0;
      background: linear-gradient(180deg, rgba(255, 245, 250, 0.20), rgba(174, 47, 99, 0.06));
      backdrop-filter: blur(6px) saturate(110%);
      -webkit-backdrop-filter: blur(8px) saturate(110%);
      pointer-events: none;
      z-index: 0;
    }

    button, input, textarea, select { font: inherit; }
    button { cursor: pointer; }
    button:focus-visible, input:focus-visible, textarea:focus-visible, select:focus-visible {
      outline: 3px solid rgba(173, 47, 99, 0.32);
      outline-offset: 2px;
    }

    .sr-only {
      position: absolute;
      width: 1px;
      height: 1px;
      padding: 0;
      margin: -1px;
      overflow: hidden;
      clip: rect(0, 0, 0, 0);
      white-space: nowrap;
      border: 0;
    }

    .site-wrap { width: min(1180px, calc(100% - 32px)); margin: 18px auto; position: relative; z-index: 1; }

    /* Frosted, readable panel for iOS-like UX */
    .site-wrap {
      background: rgba(255, 250, 253, 0.80);
      border-radius: 24px;
      padding: 28px;
      box-shadow: 0 18px 46px rgba(113, 43, 73, 0.13);
      backdrop-filter: blur(6px) saturate(110%);
      -webkit-backdrop-filter: blur(8px) saturate(110%);
      border: 1px solid rgba(255, 255, 255, 0.74);
      color: var(--ink);
    }

    .topbar {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 20px;
      padding: 26px 0 18px;
    }

    .brand { display: inline-flex; align-items: center; gap: 11px; color: var(--ink); text-decoration: none; }
    .brand-mark {
      display: grid;
      width: 42px;
      height: 42px;
      place-items: center;
      color: #fffaf5;
      background: var(--wine);
      border-radius: 14px 14px 14px 4px;
      box-shadow: 0 8px 20px rgba(173, 47, 99, 0.22);
      font-family: Georgia, serif;
      font-size: 1.45rem;
      font-weight: 700;
    }
    .brand-name { font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; font-weight: 700; letter-spacing: -0.02em; }
    .brand-subtitle { display: block; margin-top: 2px; color: var(--muted); font-size: 0.74rem; font-weight: 600; letter-spacing: 0.08em; text-transform: uppercase; }

    .quiet-note { display: flex; align-items: center; gap: 8px; color: var(--muted); font-size: 0.84rem; }
    .status-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--sage); box-shadow: 0 0 0 4px var(--sage-soft); }
    .quiet-note.is-online .status-dot { background: #31865b; box-shadow: 0 0 0 4px #dcf5e7; }
    .quiet-note.is-connecting .status-dot { background: #c18417; box-shadow: 0 0 0 4px #fff1c9; animation: status-pulse 1.2s ease-in-out infinite; }
    .quiet-note.is-offline .status-dot { background: #b34b4b; box-shadow: 0 0 0 4px #fbe1e1; }

    @keyframes status-pulse {
      50% { transform: scale(0.72); opacity: 0.62; }
    }

    .hero {
      position: relative;
      overflow: hidden;
      padding: clamp(34px, 6vw, 74px);
      border: 1px solid rgba(255, 239, 247, 0.70);
      border-radius: 30px;
      background:
        radial-gradient(circle at 82% 18%, rgba(255, 225, 239, 0.34) 0, transparent 23%),
        linear-gradient(125deg, #861c4d 0%, #c53f76 52%, #ec9bb7 100%);
      box-shadow: var(--shadow);
      color: #fffaf6;
      isolation: isolate;
    }
    .hero::before {
      position: absolute;
      z-index: 0;
      right: -32px;
      bottom: -110px;
      color: rgba(255, 248, 252, 0.12);
      content: "“";
      font-family: Georgia, serif;
      font-size: 29rem;
      line-height: 1;
    }
    .hero::after {
      position: absolute;
      z-index: 0;
      top: 28px;
      right: 15%;
      width: 158px;
      height: 158px;
      border: 1px solid rgba(255, 255, 255, 0.17);
      border-radius: 50%;
      content: "";
    }
    .hero-glow {
      position: absolute;
      z-index: 0;
      top: -110px;
      right: 16%;
      width: 270px;
      height: 270px;
      border-radius: 50%;
      background: rgba(255, 234, 245, 0.15);
      filter: blur(2px);
      pointer-events: none;
    }
    .hero-content { position: relative; z-index: 2; }
    .hero-birds { position: absolute; z-index: 1; inset: 0; pointer-events: none; }
    .hero-bird {
      position: absolute;
      display: block;
      color: rgba(255, 242, 248, 0.92);
      filter: drop-shadow(0 5px 7px rgba(97, 20, 54, 0.15));
    }
    .hero-bird svg { display: block; width: 100%; height: auto; fill: none; stroke: currentColor; stroke-linecap: round; stroke-linejoin: round; stroke-width: 2.15; }
    .bird-one { --bird-tilt: -8deg; top: 20%; right: 12%; width: clamp(56px, 7vw, 91px); transform: rotate(var(--bird-tilt)); }
    .bird-two { --bird-tilt: 5deg; top: 36%; right: 4%; width: clamp(39px, 5vw, 64px); color: rgba(255, 237, 246, 0.72); transform: rotate(var(--bird-tilt)); }
    .bird-three { --bird-tilt: -4deg; top: 10%; right: 29%; width: clamp(31px, 4vw, 48px); color: rgba(255, 244, 249, 0.62); transform: rotate(var(--bird-tilt)); }
    .eyebrow { margin: 0 0 13px; color: #ffe0ed; font-size: 0.78rem; font-weight: 700; letter-spacing: 0.12em; text-transform: uppercase; }
    h1, h2, h3, p { margin-top: 0; }
    h1 { max-width: 710px; margin-bottom: 17px; font-family: Georgia, "Times New Roman", serif; font-size: clamp(2.35rem, 5vw, 4.75rem); font-weight: 500; letter-spacing: -0.055em; line-height: 0.98; }
    .hero-copy { max-width: 550px; margin-bottom: 30px; color: rgba(255, 246, 250, 0.88); font-size: 1.04rem; line-height: 1.7; }
    .hero-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }

    .button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 9px;
      min-height: 46px;
      padding: 0 18px;
      border: 1px solid transparent;
      border-radius: 14px;
      font-weight: 700;
      text-decoration: none;
      transition: transform 160ms ease, background 160ms ease, border-color 160ms ease;
    }
    .button:hover { transform: translateY(-1px); }
    .button-primary { color: var(--wine-dark); background: #fff8fc; box-shadow: 0 8px 18px rgba(91, 16, 52, 0.13); }
    .button-primary:hover { background: #ffffff; }
    .button-ghost { color: #fff9fb; border-color: rgba(255, 255, 255, 0.48); background: rgba(255, 255, 255, 0.04); }
    .button-ghost:hover { background: rgba(255, 255, 255, 0.11); }
    .topbar .button-ghost { color: var(--wine); border-color: #e7b8ca; background: rgba(255, 248, 252, 0.78); }
    .topbar .button-ghost:hover { background: var(--wine-soft); }
    .button-secondary { color: var(--wine); border-color: #e9bdcf; background: #fff8fc; }
    .button-secondary:hover { background: var(--wine-soft); }
    .button-danger { color: #9b3030; border-color: #edcccc; background: #fffafa; }
    .button-danger:hover { background: #ffecec; }
    .icon { width: 1.05em; height: 1.05em; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }

    .content-grid { display: grid; grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; padding: 32px 0 48px; }
    .main-column { min-width: 0; }

    .search-row { display: flex; gap: 12px; margin-bottom: 22px; }
    .search-box { position: relative; flex: 1; }
    .search-box .icon { position: absolute; top: 50%; left: 16px; width: 19px; height: 19px; color: var(--muted); transform: translateY(-50%); }
    .search-box input {
      width: 100%;
      min-height: 52px;
      padding: 0 16px 0 47px;
      border: 1px solid var(--line);
      border-radius: 16px;
      color: var(--ink);
      background: rgba(255, 250, 253, 0.88);
      box-shadow: 0 6px 20px rgba(108, 41, 69, 0.05);
    }
    .search-box input::placeholder { color: #aa8798; }

    .filter-bar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 30px; }
    .filter-chip {
      min-height: 37px;
      padding: 0 13px;
      border: 1px solid var(--line);
      border-radius: 999px;
      color: #725667;
      background: rgba(255, 249, 252, 0.78);
      font-size: 0.88rem;
      font-weight: 650;
      transition: background 150ms ease, color 150ms ease, border-color 150ms ease;
    }
    .filter-chip:hover { border-color: #d891af; background: #fff1f7; }
    .filter-chip.is-active { border-color: var(--wine); color: #fffaf7; background: var(--wine); }

    .section-heading { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 15px; }
    .section-heading h2 { margin: 0; font-family: Georgia, "Times New Roman", serif; font-size: 1.65rem; font-weight: 500; letter-spacing: -0.03em; }
    .entry-count { color: var(--muted); font-size: 0.9rem; }

    .entry-list { display: grid; gap: 14px; }
    .entry-card {
      position: relative;
      overflow: hidden;
      padding: 24px;
      border: 1px solid rgba(237, 206, 220, 0.92);
      border-radius: var(--radius);
      background: rgba(255, 251, 253, 0.92);
      box-shadow: 0 9px 24px rgba(110, 43, 70, 0.06);
      transition: transform 160ms ease, box-shadow 160ms ease;
    }
    .entry-card:hover { transform: translateY(-2px); box-shadow: 0 16px 32px rgba(110, 43, 70, 0.12); }
    .entry-card::before { position: absolute; top: 0; left: 0; width: 5px; height: 100%; background: var(--wine); content: ""; }
    .entry-card.quote::before { background: var(--sage); }
    .card-topline { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 15px; }
    .type-label { display: inline-flex; align-items: center; gap: 7px; color: var(--wine); font-size: 0.78rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; }
    .quote .type-label { color: var(--sage); }
    .type-dot { width: 7px; height: 7px; border-radius: 50%; background: currentColor; }
    .date { color: var(--muted); font-size: 0.78rem; }
    .entry-text { margin: 0 0 17px; white-space: pre-line; font-family: Georgia, "Times New Roman", serif; font-size: clamp(1.1rem, 2vw, 1.28rem); line-height: 1.68; }
    .entry-text.is-locked { color: var(--muted); font-style: italic; }
    .lock-badge { margin-left: 8px; padding: 4px 7px; border-radius: 8px; color: var(--wine); background: var(--wine-soft); font-size: 0.72rem; font-weight: 700; }
    .entry-author { margin: 0 0 15px; color: var(--muted); font-size: 0.92rem; }
    .entry-author::before { content: "— "; }
    .card-footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 12px; }
    .tag-list { display: flex; flex-wrap: wrap; gap: 7px; }
    .tag { padding: 5px 9px; border-radius: 999px; color: #805468; background: #fde9f1; font-size: 0.76rem; font-weight: 650; }
    .card-actions { display: flex; flex-wrap: wrap; gap: 7px; }
    .small-button {
      display: inline-flex;
      align-items: center;
      justify-content: center;
      gap: 6px;
      min-height: 33px;
      padding: 0 9px;
      border: 1px solid transparent;
      border-radius: 10px;
      color: var(--muted);
      background: transparent;
      font-size: 0.79rem;
      font-weight: 700;
      transition: background 150ms ease, color 150ms ease;
    }
    .small-button:hover { color: var(--wine); background: var(--wine-soft); }
    .small-button.is-favorite { color: var(--wine); background: #f8e9eb; }
    .small-button.delete:hover { color: #9b3030; background: #ffecec; }

    .side-column { display: grid; align-content: start; gap: 16px; }
    .side-card { padding: 22px; border: 1px solid rgba(237, 206, 220, 0.92); border-radius: var(--radius); background: rgba(255, 251, 253, 0.82); }
    .side-card h2 { margin: 0 0 17px; font-family: Georgia, "Times New Roman", serif; font-size: 1.28rem; font-weight: 500; letter-spacing: -0.025em; }
    .stat-list { display: grid; gap: 12px; }
    .stat-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding-bottom: 12px; border-bottom: 1px solid var(--line); }
    .stat-row:last-child { padding-bottom: 0; border-bottom: 0; }
    .stat-name { color: var(--muted); font-size: 0.87rem; }
    .stat-value { color: var(--wine); font-family: Georgia, serif; font-size: 1.45rem; }
    .memory-card { color: #fff8fc; background: linear-gradient(145deg, #812348, #bb4b78); border-color: transparent; box-shadow: 0 12px 28px rgba(116, 35, 72, 0.16); }
    .memory-card h2 { color: #fff9fc; }
    .memory-card p { margin-bottom: 0; color: rgba(255, 247, 251, 0.82); font-size: 0.92rem; line-height: 1.65; }
    .memory-card .line { display: block; width: 42px; height: 1px; margin: 16px 0; background: rgba(255,255,255,0.45); }

    .empty-state { padding: 48px 22px; border: 1px dashed #dfaec2; border-radius: var(--radius); color: var(--muted); background: rgba(255, 249, 252, 0.65); text-align: center; }
    .empty-state h3 { margin-bottom: 8px; color: var(--ink); font-family: Georgia, serif; font-size: 1.3rem; font-weight: 500; }
    .empty-state p { margin-bottom: 18px; font-size: 0.92rem; }

    footer { padding: 8px 0 34px; color: var(--muted); font-size: 0.84rem; text-align: center; }

    dialog {
      width: min(620px, calc(100% - 28px));
      max-height: calc(100dvh - 28px);
      overflow-y: auto;
      padding: 0;
      border: 0;
      border-radius: 24px;
      color: var(--ink);
      background: var(--paper);
      box-shadow: 0 28px 80px rgba(35, 20, 24, 0.34);
    }
    dialog::backdrop { background: rgba(70, 19, 45, 0.52); backdrop-filter: blur(3px); }
    .dialog-inner { padding: clamp(22px, 5vw, 34px); }
    .dialog-heading { display: flex; align-items: flex-start; justify-content: space-between; gap: 14px; margin-bottom: 24px; }
    .dialog-heading h2 { margin: 0 0 5px; font-family: Georgia, "Times New Roman", serif; font-size: 1.85rem; font-weight: 500; letter-spacing: -0.035em; }
    .dialog-heading p { margin: 0; color: var(--muted); font-size: 0.91rem; }
    .close-button { display: grid; width: 36px; height: 36px; flex: none; place-items: center; border: 1px solid var(--line); border-radius: 10px; color: var(--muted); background: transparent; }
    .close-button:hover { color: var(--wine); background: var(--wine-soft); }
    .form-grid { display: grid; gap: 18px; }
    .field { display: grid; gap: 8px; }
    .field label, .field-title { color: #765264; font-size: 0.86rem; font-weight: 750; }
    .field input, .field textarea, .field select {
      width: 100%;
      border: 1px solid var(--line);
      border-radius: 13px;
      color: var(--ink);
      background: #fffbfd;
    }
    .field input, .field select { min-height: 45px; padding: 0 12px; }
    .field textarea { min-height: 152px; padding: 12px; resize: vertical; line-height: 1.55; }
    .type-options { display: flex; flex-wrap: wrap; gap: 10px; }
    .type-option { display: inline-flex; align-items: center; gap: 8px; min-height: 42px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; background: #fffbfd; }
    .type-option input { accent-color: var(--wine); }
    .protect-option { display: flex; align-items: center; gap: 9px; color: #765264; font-size: 0.9rem; font-weight: 700; cursor: pointer; }
    .protect-option input { accent-color: var(--wine); }
    .protected-fields { display: grid; gap: 14px; padding: 16px; border: 1px solid var(--line); border-radius: 13px; background: #fffbfd; }
    .protected-fields[hidden] { display: none; }
    .field-hint { margin: 0; color: var(--muted); font-size: 0.81rem; line-height: 1.5; }
    .form-actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 10px; padding-top: 6px; }
    .form-error { min-height: 1.2em; margin: -4px 0 0; color: #a13333; font-size: 0.86rem; }

    .toast {
      position: fixed;
      z-index: 10;
      right: 22px;
      bottom: 22px;
      max-width: min(360px, calc(100% - 44px));
      padding: 12px 16px;
      border-radius: 13px;
      color: #fffaf5;
      background: #4d1934;
      box-shadow: 0 12px 36px rgba(76, 23, 50, 0.24);
      font-size: 0.9rem;
      opacity: 0;
      pointer-events: none;
      transform: translateY(12px);
      transition: opacity 180ms ease, transform 180ms ease;
    }
    .toast.show { opacity: 1; transform: translateY(0); }

    @keyframes text-reveal {
      from { opacity: 0; transform: translateY(22px); filter: blur(4px); }
      to { opacity: 1; transform: translateY(0); filter: blur(0); }
    }
    @keyframes header-reveal {
      from { opacity: 0; transform: translateY(-12px); }
      to { opacity: 1; transform: translateY(0); }
    }
    @keyframes bird-arrive {
      from { opacity: 0; transform: translate3d(32px, -18px, 0) rotate(var(--bird-tilt)) scale(0.78); }
      to { opacity: 1; transform: rotate(var(--bird-tilt)) scale(1); }
    }
    @keyframes bird-glide {
      0%, 100% { transform: translate3d(0, 0, 0) rotate(0); }
      50% { transform: translate3d(-10px, -7px, 0) rotate(-3deg); }
    }
    @keyframes card-reveal {
      from { opacity: 0; transform: translateY(22px) scale(0.985); }
      to { opacity: 1; transform: translateY(0) scale(1); }
    }

    @media (prefers-reduced-motion: no-preference) {
      .topbar { animation: header-reveal 580ms cubic-bezier(.22, .8, .32, 1) backwards; }
      .hero .eyebrow { animation: text-reveal 620ms cubic-bezier(.22, .8, .32, 1) 90ms backwards; }
      .hero h1 { animation: text-reveal 700ms cubic-bezier(.22, .8, .32, 1) 180ms backwards; }
      .hero .hero-copy { animation: text-reveal 680ms cubic-bezier(.22, .8, .32, 1) 290ms backwards; }
      .hero .hero-actions { animation: text-reveal 620ms cubic-bezier(.22, .8, .32, 1) 400ms backwards; }
      .hero-bird { animation: bird-arrive 900ms cubic-bezier(.2, .8, .3, 1) backwards; }
      .bird-one { animation-delay: 260ms; }
      .bird-two { animation-delay: 430ms; }
      .bird-three { animation-delay: 580ms; }
      .hero-bird svg { animation: bird-glide 5.8s ease-in-out 1.15s infinite; }
      .bird-two svg { animation-duration: 6.6s; animation-delay: 1.45s; }
      .bird-three svg { animation-duration: 5.1s; animation-delay: 1.75s; }
      .search-row { animation: text-reveal 600ms cubic-bezier(.22, .8, .32, 1) 430ms backwards; }
      .filter-bar { animation: text-reveal 600ms cubic-bezier(.22, .8, .32, 1) 500ms backwards; }
      .section-heading { animation: text-reveal 600ms cubic-bezier(.22, .8, .32, 1) 570ms backwards; }
      .side-card { animation: card-reveal 650ms cubic-bezier(.22, .8, .32, 1) backwards; }
      .side-card:nth-child(2) { animation-delay: 110ms; }
      .entry-card.reveal-card { opacity: 0; transform: translateY(22px) scale(0.985); }
      .entry-card.reveal-card.is-visible {
        opacity: 1;
        transform: translateY(0) scale(1);
        animation: card-reveal 620ms cubic-bezier(.22, .8, .32, 1) var(--card-delay, 0ms) backwards;
      }
      .entry-card.reveal-card.is-visible:hover { transform: translateY(-2px); }
    }

    @media (max-width: 850px) {
      .content-grid { grid-template-columns: 1fr; }
      .side-column { grid-template-columns: repeat(2, minmax(0, 1fr)); }
      .memory-card { grid-column: span 2; }
    }
    @media (max-width: 590px) {
      .site-wrap { width: min(100% - 24px, 1180px); }
      .topbar { padding-top: 18px; flex-wrap: wrap; }
      .quiet-note { order: 3; width: 100%; font-size: 0.76rem; }
      .hero { border-radius: 24px; }
      .hero-actions .button { width: 100%; }
      .search-row { flex-direction: column; }
      .search-row .button { width: 100%; }
      .entry-card { padding: 20px; }
      .card-footer { align-items: flex-start; flex-direction: column; }
      .side-column { grid-template-columns: 1fr; }
      .memory-card { grid-column: auto; }
      .date { display: none; }
      .form-actions .button { flex: 1; }
      .hero-birds { opacity: 0.62; }
      .bird-three { display: none; }
      .bird-one { top: 14%; right: 8%; }
      .bird-two { top: 31%; right: -2%; }
    }

    @media (prefers-reduced-motion: reduce) {
      *, *::before, *::after {
        scroll-behavior: auto !important;
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
      }
    }
