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

  body {
    background: linear-gradient(135deg, #fdf8f4 0%, #f5efe8 100%);
    min-height: 100vh;
    padding: 40px 8px 100px;
    font-family: 'Inter', sans-serif;
  }

  .container { max-width: 1200px; margin: 0 auto; padding: 80px 20px 40px; }

  .autosave-indicator {
    position: fixed; top: 16px; right: 16px;
    background: rgba(255,255,255,0.95);
    border: 1px solid rgba(201,169,110,0.3);
    border-radius: 50px; padding: 6px 14px;
    font-size: 11px; color: #8b5e3c; font-weight: 600;
    z-index: 998; opacity: 0; transition: opacity 0.3s; pointer-events: none;
  }
  .autosave-indicator.visible { opacity: 1; }

  .guest-banner {
    background: linear-gradient(135deg,#fdf0e0,#f5e6d0);
    border: 1px solid #e0c9a6; border-radius: 16px;
    padding: 20px 28px; margin-bottom: 24px;
    text-align: center; color: #7a5230; font-size: 14px;
  }
  .guest-banner strong { display:block; font-size:16px; margin-bottom:8px; }
  .login-btn {
    display:inline-block; margin-top:12px; background:#c9a96e;
    color:white; padding:8px 24px; border-radius:50px;
    text-decoration:none; font-size:13px; font-weight:600; transition:background 0.2s;
  }
  .login-btn:hover { background:#b08040; color:white; }
  .user-welcome { text-align:center; margin-bottom:20px; color:#8b5e3c; }

  .toolbar {
    position: fixed; bottom: 28px; left: 50%; transform: translateX(-50%);
    background: rgba(255,255,255,0.95);
    border: 1.5px solid rgba(201,169,110,0.3);
    border-radius: 100px; padding: 10px 22px;
    display: flex; align-items: center; gap: 12px;
    z-index: 999; box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    backdrop-filter: blur(8px); font-size: 12px; color: #8b5e3c;
    font-weight: 600; white-space: nowrap;
  }
  /* Photo */
  .item-photo-btn {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(201,169,110,0.4);
    color: #c9a96e;
    font-size: 11px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    margin-top: 2px;
    transition: background 0.2s;
    opacity: 0;
  }
  .item:hover .item-photo-btn { opacity: 1; }
  .item-photo-btn:hover { background: #c9a96e; color: white; border-color: #c9a96e; }

  .item-text-link {
    color: inherit;
    text-decoration: line-through;
    text-decoration-color: #c9a96e;
    cursor: pointer;
    pointer-events: auto;
  }
  .item-text-link:hover { color: #8b5e3c; }

  /* Modal foto */
  .photo-modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(44,24,16,0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
  }
  .photo-modal-overlay.open { display: flex; }
  .photo-modal {
    background: white;
    border-radius: 20px;
    padding: 24px;
    max-width: 360px;
    width: 90%;
    text-align: center;
    box-shadow: 0 20px 60px rgba(44,24,16,0.2);
  }
  .photo-modal h4 {
    font-family: 'Playfair Display', serif;
    font-size: 15px;
    color: #2c1810;
    margin-bottom: 16px;
    font-style: italic;
  }
  .photo-modal-img {
    width: 100%;
    aspect-ratio: 1/1;
    object-fit: cover;
    border-radius: 12px;
    display: block;
    margin-bottom: 12px;
  }
  .photo-modal-placeholder {
    width: 100%;
    aspect-ratio: 1/1;
    background: #f5efe8;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #c4a882;
    font-size: 13px;
    margin-bottom: 12px;
    border: 1.5px dashed #d9c4ad;
  }
  .photo-modal-input {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid #d9c4ad;
    padding: 8px 0;
    font-family: 'Playfair Display', serif;
    font-style: italic;
    font-size: 12px;
    color: #2c1810;
    outline: none;
    margin-bottom: 16px;
    text-align: center;
  }
  .photo-modal-input::placeholder { color: #c4a882; }
  .photo-modal-btns { display: flex; gap: 8px; justify-content: center; }
  .photo-modal-save { background: #c9a96e; border: none; border-radius: 50px; padding: 7px 20px; color: white; font-size: 12px; font-weight: 700; cursor: pointer; }
  .photo-modal-close { background: transparent; border: 1.5px solid rgba(201,169,110,0.4); border-radius: 50px; padding: 7px 16px; color: #a08060; font-size: 12px; font-weight: 600; cursor: pointer; }
  
  
  .memory-card { background: rgba(255,255,255,0.5); border-radius: 16px; padding: 16px; }
  .memory-label { font-size: clamp(9px,2vw,10px); font-weight: 500; letter-spacing: 0.2em; text-transform: uppercase; color: #a08060; margin-bottom: 8px; display: block; }
  .memory-input { width: 100%; background: transparent; border: none; border-bottom: 1px solid #d9c4ad; padding: 8px 0; font-family: 'Playfair Display', serif; font-style: italic; font-size: clamp(12px,2.5vw,13px); color: #2c1810; outline: none; display: block; }
  .memory-input::placeholder { color: #c4a882; }

  .footer-note { text-align: center; margin-top: 32px; padding-top: 20px; border-top: 0.5px solid #d9c4ad; }
  .footer-note span { font-family: 'Playfair Display', serif; font-style: italic; font-size: clamp(11px,2vw,12px); color: #a08060; letter-spacing: 0.04em; padding: 4px 8px; border-radius: 8px; display: inline-block; }
  .edit-hint { text-align: center; margin-top: 20px; font-size: 11px; color: #a08060; letter-spacing: 0.08em; }

  .reset-modal-overlay { display: none; position: fixed; inset: 0; background: rgba(44,24,16,0.35); z-index: 9999; align-items: center; justify-content: center; }
  .reset-modal-overlay.open { display: flex; }
  .reset-modal { background: white; border-radius: 20px; padding: 28px 32px; max-width: 340px; width: 90%; text-align: center; box-shadow: 0 20px 60px rgba(44,24,16,0.15); }
  .reset-modal h3 { font-family: 'Playfair Display', serif; font-size: 18px; color: #2c1810; margin-bottom: 10px; }
  .reset-modal p { font-size: 13px; color: #8b5e3c; margin-bottom: 20px; line-height: 1.6; }
  .reset-modal-btns { display: flex; gap: 10px; justify-content: center; }
  .modal-cancel { background: transparent; border: 1.5px solid rgba(201,169,110,0.4); border-radius: 50px; padding: 8px 20px; color: #a08060; font-size: 12px; font-weight: 600; cursor: pointer; }
  .modal-confirm { background: #c9a96e; border: none; border-radius: 50px; padding: 8px 20px; color: white; font-size: 12px; font-weight: 700; cursor: pointer; }
  .modal-confirm:hover { background: #b58a4a; }
  
  
  @media (max-width: 768px) { .toolbar { bottom:20px; padding:8px 16px; font-size:10px; gap:8px; } }
  @media (max-width: 480px) { .toolbar { bottom:16px; padding:7px 12px; font-size:9px; gap:6px; } }

  .toolbar-dot { width:8px; height:8px; border-radius:50%; background:#c9a96e; animation:blink 2s ease-in-out infinite; }
  @keyframes blink { 0%,100%{opacity:1;} 50%{opacity:0.3;} }

  .toolbar-login-btn {
    background: #c9a96e;
    border: none; padding: 4px 16px; border-radius: 50px;
    color: white; font-size: 11px; font-weight: 700; cursor: pointer;
    text-decoration: none; display: inline-flex; align-items: center; gap: 5px;
    transition: background 0.2s;
  }
  .toolbar-login-btn:hover { background: #b08040; color: white; }

  .toolbar-copy-btn {
    background: transparent;
    border: 1.5px solid rgba(201,169,110,0.5);
    padding: 4px 12px; border-radius: 50px;
    color: #a08060; font-size: 11px; font-weight: 600; cursor: pointer;
    transition: all 0.2s; display: flex; align-items: center; gap: 5px;
  }
  .toolbar-copy-btn:hover { background: rgba(201,169,110,0.1); color: #8b5e3c; border-color: #c9a96e; }

  .save-btn { background:#c9a96e; border:none; padding:4px 14px; border-radius:50px; color:white; font-size:11px; font-weight:600; cursor:pointer; transition:transform 0.2s; margin-left:8px; }
  .save-btn:hover { transform:scale(1.02); background:#b58a4a; }

  .reset-btn { background:transparent; border:1.5px solid rgba(201,169,110,0.4); padding:4px 12px; border-radius:50px; color:#a08060; font-size:11px; font-weight:600; cursor:pointer; transition:all 0.2s; }
  .reset-btn:hover { background:rgba(201,169,110,0.1); color:#8b5e3c; border-color:#c9a96e; }

  .save-status { font-size:10px; color:#8b5e3c; }

  .page { width:100%; background:#fdf8f4; border:0.5px solid #d9c4ad; border-radius:20px; padding:40px 24px 36px; }
  @media (max-width:768px) { .page { padding:24px 20px 28px; } }
  @media (max-width:480px) { .page { padding:20px 16px 24px; } }

  .editable-mode [contenteditable="true"] { outline:none; border-radius:6px; transition:background 0.2s; cursor:text; }
  .editable-mode [contenteditable="true"]:hover { background:rgba(201,169,110,0.1); }
  .editable-mode [contenteditable="true"]:focus { background:rgba(255,255,255,0.9); box-shadow:0 0 0 2px #c9a96e; }

  .header { text-align:center; margin-bottom:32px; }
  .crown { font-size:clamp(18px,4vw,22px); letter-spacing:clamp(8px,3vw,12px); color:#c9a96e; display:block; margin-bottom:10px; }
  .title { font-family:'Playfair Display',serif; font-size:clamp(24px,5vw,32px); font-weight:400; color:#2c1810; line-height:1.2; margin-bottom:4px; display:flex; justify-content:center; align-items:baseline; flex-wrap:wrap; gap:8px; }
  @media (max-width:767px) { .title { flex-direction:column; align-items:center; gap:4px; } }
  .title em { font-style:italic; color:#8b5e3c; }
  .subtitle { font-size:clamp(10px,2vw,12px); letter-spacing:0.18em; text-transform:uppercase; color:#a08060; margin-top:10px; display:block; }

  .divider { display:flex; align-items:center; gap:12px; margin:20px 0; }
  .divider-line { flex:1; height:0.5px; background:#d9c4ad; }
  .divider-dot  { width:5px; height:5px; border-radius:50%; background:#c9a96e; }
  /* ── NAMES ROW BARU — flexible ── */
  .names-row {
    margin-bottom: 28px;
  }
  .names-list {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    justify-content: center;
    align-items: center;
    margin-bottom: 10px;
  }
  .name-item {
    display: flex;
    align-items: center;
    gap: 6px;
    background: transparent;
    font-family: 'Playfair Display', serif;
    font-size: clamp(13px, 3vw, 15px);
    font-style: italic;
    border-radius: 50px;
    padding: 6px 14px 6px 10px;
    border: 1px solid #d9c4ad;
    transition: border-color 0.2s;
    position: relative;
  }
  .name-item:focus-within {
    border-color: #c9a96e;
  }
  
  .name-input {
    appearance: none;
    -webkit-appearance: none;

    background: transparent !important;
    background-color: transparent !important;

    border: none !important;
    outline: none !important;
    box-shadow: none !important;

    font-family: 'Playfair Display', serif !important;
    font-style: italic !important;
    font-weight: 400;

    color: #c9a96e !important;


    text-align: center;

    padding: 0;
    margin: 0;

    width: 110px;
    min-width: 60px;

  }

  .name-input:focus,
  .name-input:active,
  .name-input:focus-visible {
    border: none !important;
    outline: none !important;
    box-shadow: none !important;
    background: transparent !important;
  }

  .name-input::placeholder {
    font-style: italic;
    color: #c9a96e !important;
  }
 
  
  /* Tombol hapus orang */
  .name-remove-btn {
    width: 18px; height: 18px;
    border-radius: 50%;
    background: transparent;
    border: 1px solid rgba(201,169,110,0.3);
    color: #c9a96e;
    font-size: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    opacity: 0;
    transition: opacity 0.2s, background 0.2s;
    padding: 0;
    line-height: 1;
  }
  .name-item:hover .name-remove-btn { opacity: 1; }
  .name-remove-btn:hover { background: #c9a96e; color: white; border-color: #c9a96e; }
  /* Separator antar orang */
  .name-sep {
    font-size: 14px;
    color: #c9a96e;
    flex-shrink: 0;
    user-select: none;
  }
 
  /* Tombol tambah orang */
  .add-person-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 5px;
    background: transparent;
    border: 1.5px dashed rgba(201,169,110,0.4);
    border-radius: 50px;
    padding: 6px 16px;
    color: #a08060;
    font-size: 11px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
    margin: 0 auto;
    display: block;
  }
  .add-person-btn:hover {
    background: rgba(201,169,110,0.08);
    border-color: #c9a96e;
    color: #8b5e3c;
  }
  .readonly .name-input, .readonly .memory-input { border-bottom-color:transparent; pointer-events:none; }
  .readonly .name-input { border-bottom-color: transparent; pointer-events: none; }
  .readonly .name-remove-btn,
  .readonly .add-person-btn { display: none; }
  .heart-sep { font-size:clamp(12px,3vw,14px); color:#c9a96e; }

  .progress-wrap { margin:24px 0 20px; }
  .progress-label { display:flex; justify-content:space-between; font-size:clamp(9px,2vw,10px); letter-spacing:0.1em; text-transform:uppercase; color:#a08060; margin-bottom:6px; }
  .progress-bar  { height:3px; background:#e8d9c8; border-radius:2px; overflow:hidden; }
  .progress-fill { height:100%; background:linear-gradient(90deg,#c9a96e,#8b5e3c); border-radius:2px; transition:width 0.4s ease; }

  .sections-grid { display:grid; gap:24px; margin-bottom:24px; }
  @media (min-width:992px) { .sections-grid { grid-template-columns:repeat(2,1fr); gap:28px; } }

  .section { background:rgba(255,255,255,0.5); border-radius:16px; padding:16px; }
  @media (max-width:480px) { .section { padding:12px; } }

  .section-header { display:flex; align-items:center; gap:8px; margin-bottom:12px; }
  .section-title { font-size:clamp(9px,2vw,11px); font-weight:500; letter-spacing:0.22em; text-transform:uppercase; color:#a08060; flex:1; display:flex; align-items:center; gap:8px; }
  .section-title::after { content:''; flex:1; height:0.5px; background:#e0cdb8; }

  .section-delete-btn { width:22px; height:22px; border-radius:50%; background:rgba(255,255,255,0.8); border:1px solid rgba(201,169,110,0.4); color:#c9a96e; font-size:12px; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; opacity:0; transition:opacity 0.2s, background 0.2s; }
  .section:hover .section-delete-btn { opacity:1; }
  .section-delete-btn:hover { background:#c9a96e; color:white; }

  .item { display:flex; align-items:flex-start; gap:10px; padding:8px 0; border-bottom:0.5px solid #f0e6d8; position:relative; }
  .item:last-child { border-bottom:none; }

  .checkbox { width:18px; height:18px; border:1.5px solid #c9a96e; border-radius:4px; flex-shrink:0; margin-top:2px; display:flex; align-items:center; justify-content:center; transition:background 0.2s; background:#fdf8f4; cursor:pointer; }
  .checkbox.checked { background:#c9a96e; border-color:#c9a96e; }
  .checkbox.checked::after { content:'✓'; font-size:11px; color:#fff; font-weight:500; }

  .item-text { font-size:clamp(12px,2.5vw,13px); color:#3d2b1f; line-height:1.5; flex:1; padding:2px 4px; margin:-2px -4px; border-radius:6px; }
  .editable-mode .item-text { cursor:text; outline:none; transition:background 0.2s; }
  .editable-mode .item-text:hover { background:rgba(201,169,110,0.1); }
  .editable-mode .item-text:focus { background:rgba(255,255,255,0.9); box-shadow:0 0 0 2px #c9a96e; }
  .item.checked-item .item-text { text-decoration:line-through; color:#b8a090; }

  .item-delete-btn { width:18px; height:18px; border-radius:50%; background:transparent; border:1px solid rgba(201,169,110,0.3); color:#c9a96e; font-size:10px; cursor:pointer; display:flex; align-items:center; justify-content:center; flex-shrink:0; margin-top:2px; opacity:0; transition:opacity 0.2s, background 0.2s; }
  .item:hover .item-delete-btn { opacity:1; }
  .item-delete-btn:hover { background:#c9a96e; color:white; border-color:#c9a96e; }

  .add-item-btn { display:flex; align-items:center; gap:6px; margin-top:10px; background:transparent; border:1px dashed rgba(201,169,110,0.4); border-radius:8px; padding:7px 12px; color:#a08060; font-size:11px; font-weight:600; cursor:pointer; width:100%; transition:all 0.2s; letter-spacing:0.05em; }
  .add-item-btn:hover { background:rgba(201,169,110,0.08); border-color:#c9a96e; color:#8b5e3c; }

  .add-section-wrap { grid-column:1/-1; display:flex; justify-content:center; margin-top:4px; }
  .add-section-btn { background:rgba(255,255,255,0.7); border:2px dashed rgba(201,169,110,0.4); border-radius:50px; padding:9px 24px; color:#a08060; font-size:12px; font-weight:600; cursor:pointer; transition:all 0.2s; display:flex; align-items:center; gap:6px; }
  .add-section-btn:hover { background:rgba(201,169,110,0.1); border-color:#c9a96e; color:#8b5e3c; transform:translateY(-1px); }

  .memory-section { margin-top: 28px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px; }

@media (max-width: 768px) {
  .memory-section { grid-template-columns: 1fr; gap: 16px; }
}

@media (max-width: 480px) {
  body { padding: 16px 2px 80px; }
  .container { padding: 60px 2px 40px; }
  .page { padding: 20px 14px 24px; border-radius: 4px; }
  .title { font-size: clamp(28px, 7vw, 36px); gap: 4px; }
  .crown { font-size: clamp(20px, 5vw, 24px); letter-spacing: clamp(10px, 4vw, 14px); }
  .section { padding: 14px 12px; }
  .item { padding: 10px 0; gap: 12px; }
  .item-text { font-size: 14px; line-height: 1.6; }
  .checkbox { width: 22px; height: 22px; }
  .name-item { font-size: 15px; padding: 8px 16px 8px 12px; }
  .name-input { font-size: 16px; width: 130px; }
  .section-title { font-size: 11px; letter-spacing: 0.2em; }
  .memory-card { padding: 14px 12px; }
  .memory-input { font-size: 14px; }
  .toolbar {
    bottom: 0;
    left: 0;
    right: 0;
    transform: none;
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    justify-content: center;
    padding: 10px 16px;
    padding-bottom: calc(10px + env(safe-area-inset-bottom));
    -webkit-transform: translateZ(0);
    will-change: transform;
  }
}