﻿
  /* ============================================
     PET MEMORIAL PROTOTYPE — WIREFRAME STYLE
     ============================================ */
  :root {
    --bg: #F5F5F0;
    --card: #FFFFFF;
    --border: #CCCCCC;
    --text: #333333;
    --text-light: #888888;
    --accent: #8B7355;
    --accent-light: #C4A882;
    --danger: #C07070;
    --success: #7A9E7A;
    --font: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  }

  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

  body {
    font-family: var(--font);
    background: var(--bg);
    color: var(--text);
    min-height: 100vh;
    margin: 0;
    padding: 0;
  }

  /* ---- Phone Frame (removed for production) ---- */

  /* ---- Status Bar (removed for production) ---- */

  /* ---- Screen / Page Wrapper System ---- */
  .screen {
    display: none;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
  }
  .screen.active { display: flex; }
  .page-wrap {
    display: flex;
    flex-direction: column;
    min-height: 100vh;
    overflow: hidden;
    animation: fadeIn 0.3s ease;
  }
  /* ---- Home / Scan content helpers ---- */
  .home-content {
    background: linear-gradient(180deg, #F0EBE3 0%, #F5F5F0 60%);
    position: relative;
    min-height: 100vh;
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px 32px;
    text-align: center;
  }
  .scan-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 40px;
    text-align: center;
  }
  /* ---- Video duration badge ---- */
  .video-duration {
    position: absolute;
    bottom: 6px;
    right: 6px;
    background: rgba(0,0,0,0.6);
    color: white;
    font-size: 10px;
    padding: 2px 6px;
    border-radius: 4px;
  }
  .photo-grid-item.video { position: relative; }


  @keyframes fadeIn {
    from { opacity: 0; transform: translateY(6px); }
    to   { opacity: 1; transform: translateY(0); }
  }

  /* ===========================================
     SCREEN 3 — PET SPACE (GRID VIEW)
     =========================================== */
  .space-header {
    padding: 16px 20px 12px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    justify-content: space-between;
  }
  .space-header-left {
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .pet-avatar-circle {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 2px solid var(--accent-light);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
  }
  .pet-info-name {
    font-size: 17px;
    font-weight: 600;
    color: var(--text);
  }
  .pet-info-dates {
    font-size: 12px;
    color: var(--text-light);
    margin-top: 2px;
  }
  .btn-icon,
  a.btn-icon {
    display: flex;
    width: 40px;
    height: 40px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--card);
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.2s;
    text-decoration: none;
    color: var(--text);
  }
  .btn-icon:active,
  a.btn-icon:active { transform: scale(0.94); background: var(--bg); }

  /* Memorial quote strip */
  .quote-strip {
    background: var(--accent);
    color: white;
    padding: 14px 20px;
    font-size: 13px;
    font-style: italic;
    line-height: 1.5;
    position: relative;
  }
  .quote-strip::before { content: '"'; font-size: 28px; opacity: 0.3; margin-right: 4px; }

  /* Content stats bar */
  .stats-bar {
    display: flex;
    gap: 0;
    background: var(--card);
    border-bottom: 1px solid var(--border);
  }
  .stat-item,
  a.stat-item {
    flex: 1;
    padding: 12px 0;
    text-align: center;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.2s;
    text-decoration: none;
  }
  .stat-item.active,
  a.stat-item.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
    font-weight: 600;
  }
  .stat-item span,
  a.stat-item span {
    display: block;
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px;
  }

  /* Photo grid */
  .photo-grid {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    padding-bottom: 80px;
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 4px;
    background: var(--bg);
  }
  .photo-grid-item {
    aspect-ratio: 1;
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
  }
  .photo-grid-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .photo-grid-item.video::after {
    content: '▶';
    position: absolute;
    bottom: 4px;
    right: 4px;
    font-size: 10px;
    color: white;
    text-shadow: 0 1px 3px rgba(0,0,0,0.8);
  }
  .photo-placeholder {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
    color: var(--text-light);
    font-size: 11px;
  }
  .photo-placeholder-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
  }
  /* video indicator */
  .photo-grid-item.video { position: relative; }
  .photo-grid-item.video::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0,0,0,0.08);
    z-index: 1;
  }

  /* Bottom nav bar */
  .bottom-nav {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    z-index: 1000;
    background: var(--card);
    border-top: 1px solid var(--border);
    padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
    display: flex;
    justify-content: space-around;
    align-items: center;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.05);
  }
  .nav-item,
  a.nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 4px;
    cursor: pointer;
    padding: 6px 20px;
    border-radius: 12px;
    transition: all 0.2s;
    color: var(--text-light);
    font-size: 11px;
    text-decoration: none;
  }
  .nav-item.active,
  a.nav-item.active { color: var(--accent); }
  .nav-item:active,
  a.nav-item:active { transform: scale(0.92); background: var(--bg); }
  .nav-divider {
    width: 1px;
    height: 28px;
    background: var(--border);
  }

  /* FAB */
  .fab,
  a.fab {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 999;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    border: none;
    font-size: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(139,115,85,0.4);
    z-index: 20;
    transition: all 0.2s;
  }
  .fab:active { transform: scale(0.9); box-shadow: 0 2px 8px rgba(139,115,85,0.3); }

  /* ===========================================
     SCREEN 4 — UPLOAD FLOW
     =========================================== */
  .upload-header {
    padding: 16px 20px;
    background: var(--card);
    border-bottom: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 12px;
  }
  .btn-back,
  a.btn-back {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    border: 1.5px solid var(--border);
    background: var(--card);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    flex-shrink: 0;
    text-decoration: none;
  }
  .upload-header-title {
    font-size: 16px;
    font-weight: 600;
    flex: 1;
    text-align: center;
    margin-right: 48px;
  }

  .upload-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg);
  }

  /* Upload zone */
  .upload-zone {
    border: 2px dashed var(--border);
    border-radius: 16px;
    padding: 40px 20px;
    text-align: center;
    cursor: pointer;
    background: var(--card);
    transition: all 0.2s;
  }
  .upload-zone:hover, .upload-zone:active {
    border-color: var(--accent);
    background: #FAF7F2;
  }
  .upload-zone-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 14px;
  }
  .upload-zone-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 6px;
  }
  .upload-zone-sub {
    font-size: 12px;
    color: var(--text-light);
  }

  /* Preview area */
  .upload-preview {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 6px;
  }
  .preview-thumb {
    aspect-ratio: 1;
    border-radius: 8px;
    border: 1.5px solid var(--border);
    overflow: hidden;
    position: relative;
    background: var(--card);
  }
  .preview-thumb img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .preview-thumb .remove-btn {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 20px;
    height: 20px;
    border-radius: 50%;
    background: rgba(0,0,0,0.6);
    color: white;
    border: none;
    font-size: 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  /* Form fields */
  .form-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }
  .form-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    margin-bottom: 10px;
    display: flex;
    align-items: center;
    gap: 6px;
  }
  .form-label .tag {
    font-size: 10px;
    background: var(--accent-light);
    color: white;
    padding: 1px 6px;
    border-radius: 10px;
    font-weight: 400;
  }
  .form-textarea {
    width: 100%;
    border: 1px solid var(--border);
    border-radius: 10px;
    padding: 12px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    min-height: 90px;
    outline: none;
    transition: border 0.2s;
    background: var(--bg);
    color: var(--text);
  }
  .form-textarea:focus { border-color: var(--accent); }

  /* Auto quotes suggestion */
  .auto-quotes {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
  }
  .quote-chip {
    padding: 8px 14px;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    font-size: 12px;
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
    background: var(--card);
  }
  .quote-chip:hover, .quote-chip.selected {
    border-color: var(--accent);
    color: var(--accent);
    background: #FAF7F2;
  }
  .quote-chip.selected::after { content: ' ✓'; }

  /* Submit button */
  .btn-primary {
    width: 100%;
    padding: 16px;
    border-radius: 14px;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.2s;
    margin-top: 4px;
  }
  .btn-primary:active { transform: scale(0.97); background: #7A6248; }

  /* ===========================================
     SCREEN 5 — DETAIL VIEW
     =========================================== */
  .detail-media {
    width: 100%;
    aspect-ratio: 1;
    background: #222;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    position: relative;
  }
  .detail-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .detail-media .video-play-overlay {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.3);
  }
  .play-btn-circle {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: rgba(255,255,255,0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    color: #333;
  }

  .detail-body {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 16px;
    background: var(--bg);
  }
  .detail-memorial-text {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 16px;
  }
  .detail-memorial-text .label {
    font-size: 11px;
    color: var(--accent);
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 1px;
    margin-bottom: 8px;
  }
  .detail-memorial-text .text {
    font-size: 15px;
    line-height: 1.7;
    color: var(--text);
    font-style: italic;
  }
  .detail-memorial-text .source {
    font-size: 11px;
    color: var(--text-light);
    margin-top: 8px;
    text-align: right;
  }

  .detail-meta {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 12px;
    padding: 14px 16px;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .detail-meta-row {
    display: flex;
    justify-content: space-between;
    font-size: 13px;
  }
  .detail-meta-row .key { color: var(--text-light); }
  .detail-meta-row .val { color: var(--text); font-weight: 500; }

  /* ===========================================
     SCREEN 6 — EDIT PET INFO
     =========================================== */
  .edit-content {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    background: var(--bg);
  }
  .edit-avatar-section {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 24px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }
  .edit-avatar-circle {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: 2px dashed var(--border);
    background: var(--bg);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 36px;
    cursor: pointer;
    transition: all 0.2s;
    position: relative;
  }
  .edit-avatar-circle:hover { border-color: var(--accent); }
  .edit-avatar-circle .camera-badge {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 26px;
    height: 26px;
    border-radius: 50%;
    background: var(--accent);
    color: white;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 2px solid white;
  }
  .edit-avatar-label {
    font-size: 12px;
    color: var(--text-light);
  }
  .avatar-emoji-row {
    display: flex;
    gap: 10px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .avatar-emoji-btn {
    width: 42px;
    height: 42px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--bg);
    font-size: 22px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.15s;
  }
  .avatar-emoji-btn:hover { border-color: var(--accent); background: #FAF7F2; }
  .avatar-emoji-btn.selected { border-color: var(--accent); background: #FAF7F2; box-shadow: 0 0 0 2px var(--accent-light); }
  .edit-field-group {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 16px;
    overflow: hidden;
  }
  .edit-field {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    border-bottom: 1px solid var(--border);
    gap: 12px;
  }
  .edit-field:last-child { border-bottom: none; }
  .edit-field-label {
    font-size: 14px;
    color: var(--text);
    min-width: 72px;
    font-weight: 500;
  }
  .edit-field-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    font-family: inherit;
    background: transparent;
    color: var(--text);
    text-align: right;
  }
  .edit-field-input::placeholder { color: var(--text-light); }
  .date-input-group {
    display: flex;
    gap: 8px;
    align-items: center;
  }
  .date-input {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 8px 10px;
    font-size: 13px;
    font-family: inherit;
    outline: none;
    background: var(--bg);
    color: var(--text);
    transition: border 0.2s;
  }
  .date-input:focus { border-color: var(--accent); }
  .date-sep { font-size: 12px; color: var(--text-light); }

  .detail-actions {
    display: flex;
    gap: 10px;
  }
  .detail-actions button,
  .detail-actions a.action-btn {
    flex: 1;
    padding: 12px;
    border-radius: 12px;
    border: 1.5px solid var(--border);
    background: var(--card);
    font-size: 13px;
    font-family: inherit;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    transition: all 0.2s;
    color: var(--text);
    text-decoration: none;
    box-sizing: border-box;
  }
  .detail-actions button:active,
  .detail-actions a.action-btn:active { transform: scale(0.96); background: var(--bg); }
  .detail-actions button.danger,
  .detail-actions a.action-btn.danger { color: var(--danger); border-color: var(--danger); }

  /* ===========================================
     LANGUAGE MODAL
     =========================================== */
  .modal-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0,0,0,0.4);
    display: none;
    align-items: flex-end;
    justify-content: center;
    z-index: 100;
    animation: fadeIn 0.2s;
  }
  .modal-overlay.active { display: flex; }

  /* ---- Privacy Consent Modal ---- */
  .consent-overlay {
    align-items: center;
    justify-content: center;
    background: rgba(0,0,0,0.6);
    padding: 16px;
  }
  .consent-sheet {
    background: var(--card);
    border-radius: 20px;
    width: 100%;
    max-width: 420px;
    max-height: 85vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: slideUp 0.3s ease;
  }
  .consent-header {
    padding: 16px 20px 0;
    display: flex;
    justify-content: flex-end;
    flex-shrink: 0;
  }
  .consent-lang-toggle {
    display: flex;
    gap: 0;
    border: 1.5px solid var(--border);
    border-radius: 20px;
    overflow: hidden;
  }
  .consent-lang-btn {
    padding: 4px 14px;
    font-size: 12px;
    border: none;
    background: var(--card);
    color: var(--text-light);
    cursor: pointer;
    transition: all 0.2s;
  }
  .consent-lang-btn.active {
    background: var(--accent);
    color: white;
    font-weight: 600;
  }
  .consent-title {
    font-size: 18px;
    font-weight: 700;
    color: var(--text);
    text-align: center;
    padding: 12px 24px 8px;
    flex-shrink: 0;
  }
  .consent-body {
    flex: 1;
    overflow-y: auto;
    padding: 0 24px 16px;
  }
  .consent-body p {
    font-size: 13.5px;
    color: var(--text);
    line-height: 1.75;
    margin-bottom: 12px;
    text-align: justify;
  }
  .consent-body p:last-child {
    margin-bottom: 0;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--border);
  }
  .consent-policy-link {
    padding: 0 24px 16px;
    text-align: center;
    flex-shrink: 0;
  }
  .consent-policy-link a {
    font-size: 12.5px;
    color: var(--accent);
    text-decoration: underline;
    text-underline-offset: 2px;
  }
  .consent-buttons {
    padding: 0 24px 24px;
    display: flex;
    gap: 12px;
    flex-shrink: 0;
  }
  .btn-decline {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: 1.5px solid var(--border);
    background: var(--card);
    color: var(--text-light);
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
  }
  .btn-decline:active {
    background: var(--bg);
    transform: scale(0.97);
  }
  .btn-consent {
    flex: 1;
    padding: 14px;
    border-radius: 14px;
    border: none;
    background: var(--accent);
    color: white;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.2s;
  }
  .btn-consent:active {
    background: #7A6248;
    transform: scale(0.97);
  }

  .modal-sheet {
    background: var(--card);
    border-radius: 20px 20px 0 0;
    width: 100%;
    padding: 8px 0 32px;
    animation: slideUp 0.3s ease;
  }
  @keyframes slideUp {
    from { transform: translateY(100%); }
    to   { transform: translateY(0); }
  }
  .modal-handle {
    width: 36px;
    height: 4px;
    background: var(--border);
    border-radius: 2px;
    margin: 8px auto 16px;
  }
  .modal-title {
    font-size: 16px;
    font-weight: 600;
    text-align: center;
    margin-bottom: 16px;
    padding: 0 20px;
  }
  .lang-option {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 24px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .lang-option:active { background: var(--bg); }
  .lang-option-left { display: flex; align-items: center; gap: 12px; }
  .lang-flag { font-size: 22px; }
  .lang-name { font-size: 15px; }
  .lang-native { font-size: 12px; color: var(--text-light); margin-top: 1px; }
  .lang-check { color: var(--accent); font-size: 18px; }

  /* ===========================================
     TOAST / FEEDBACK
     =========================================== */
  .toast {
    position: fixed;
    bottom: 90px;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 10px 20px;
    border-radius: 20px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 200;
    animation: toast-in 0.3s ease;
    pointer-events: none;
  }
  @keyframes toast-in {
    from { opacity: 0; transform: translateX(-50%) translateY(10px); }
    to   { opacity: 1; transform: translateX(-50%) translateY(0); }
  }

  /* ===========================================
     SCREEN-SPECIFIC BOTTOM NAV OVERRIDE
     =========================================== */
  .bottom-nav.floating {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    background: rgba(255,255,255,0.95);
    backdrop-filter: blur(10px);
  }

  /* ===========================================
     EMPTY STATE
     =========================================== */
  .empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 12px;
    color: var(--text-light);
    padding: 40px;
    text-align: center;
  }
  .empty-state-icon {
    font-size: 48px;
    opacity: 0.3;
  }
  .empty-state h3 { font-size: 15px; color: var(--text); }
  .empty-state p { font-size: 13px; line-height: 1.5; }

  /* ===========================================
     MEMORY LANE (timeline view)
     =========================================== */
  .memory-timeline {
    flex: 1;
    overflow-y: auto;
    padding: 16px 20px;
    padding-bottom: 96px;
    background: var(--bg);
    display: flex;
    flex-direction: column;
    gap: 20px;
  }
  .timeline-year {
    font-size: 13px;
    font-weight: 600;
    color: var(--accent);
    padding-bottom: 8px;
    border-bottom: 1px dashed var(--accent-light);
    display: flex;
    align-items: center;
    gap: 8px;
  }
  .timeline-year::after {
    content: '';
    flex: 1;
    height: 1px;
    background: var(--border);
  }
  .timeline-item {
    background: var(--card);
    border: 1px solid var(--border);
    border-radius: 14px;
    overflow: hidden;
  }
  .timeline-item-media {
    width: 100%;
    height: 160px;
    background: #DDD;
    overflow: hidden;
    position: relative;
  }
  .timeline-item-media img {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }
  .timeline-item-body {
    padding: 12px 14px;
  }
  .timeline-item-date {
    font-size: 11px;
    color: var(--text-light);
    margin-bottom: 6px;
  }
  .timeline-item-text {
    font-size: 13px;
    color: var(--text);
    line-height: 1.5;
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .timeline-item-actions {
    display: flex;
    gap: 8px;
    margin-top: 10px;
  }
  .timeline-item-actions button {
    padding: 5px 12px;
    border-radius: 8px;
    border: 1px solid var(--border);
    background: var(--bg);
    font-size: 11px;
    cursor: pointer;
    font-family: inherit;
    transition: all 0.15s;
  }
  .timeline-item-actions button:active { transform: scale(0.95); }

  /* ===========================================
     MISC UTILITIES
     =========================================== */
  .screen-content-scroll {
    flex: 1;
    overflow-y: auto;
  }
  .screen-with-header {
    display: flex;
    flex-direction: column;
    flex: 1;
  }

  @keyframes pulse-border-btn {
    0%, 100% { border-color: var(--accent-light); box-shadow: 0 0 0 0 rgba(139,115,85,0.2); }
    50% { border-color: var(--accent); box-shadow: 0 0 0 4px rgba(139,115,85,0.1); }
  }

/* ===========================================
   PRIVACY POLICY PAGE
   =========================================== */
.policy-page {
  background: var(--bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
}

.header-lang-btn {
  width: 44px;
  height: 36px;
  border-radius: 8px;
  border: 1.5px solid var(--border);
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 12px;
  font-weight: 600;
  color: var(--accent);
  flex-shrink: 0;
}

.policy-lang-bar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 8px 20px;
  font-size: 12px;
  color: var(--text-light);
  text-align: center;
  flex-shrink: 0;
}

.policy-content {
  flex: 1;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.policy-body {
  padding: 0 0 40px;
}

.policy-section {
  padding: 20px 20px 0;
}

.policy-section h2 {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 10px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--border);
}

.policy-section p {
  font-size: 13.5px;
  color: #555;
  line-height: 1.8;
  margin-bottom: 10px;
  text-align: justify;
}

.policy-section ul {
  list-style: none;
  margin-bottom: 10px;
}

.policy-section ul li {
  font-size: 13.5px;
  color: #555;
  line-height: 1.8;
  padding-left: 16px;
  position: relative;
  margin-bottom: 4px;
}

.policy-section ul li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent-light);
}

.policy-section ul li strong {
  color: var(--text);
  font-weight: 600;
}

.policy-footer-text {
  font-size: 12px !important;
  color: var(--text-light) !important;
  text-align: right !important;
  margin-top: 4px !important;
}

/* ===========================================
   SET PASSWORD PAGE
   =========================================== */
.setpass-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 32px;
}

.setpass-lang-bar {
  display: flex;
  gap: 8px;
  padding: 12px 20px 0;
  justify-content: flex-end;
}

.setpass-lang-btn {
  padding: 4px 14px;
  border-radius: 20px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 12px;
  color: var(--text-light);
  cursor: pointer;
  transition: all 0.2s;
}
.setpass-lang-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: white;
  font-weight: 600;
}

.setpass-skip-hint {
  margin: 12px 20px 0;
  padding: 10px 14px;
  background: rgba(139,115,85,0.08);
  border-radius: 10px;
  font-size: 12.5px;
  color: var(--text-light);
  line-height: 1.6;
}

.setpass-form {
  padding: 16px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.setpass-field {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.setpass-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}

.setpass-input {
  width: 100%;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 14px;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
  box-sizing: border-box;
}
.setpass-input:focus {
  border-color: var(--accent);
}
.setpass-input::placeholder {
  color: #bbb;
}

.select-wrap {
  position: relative;
}
.setpass-select {
  width: 100%;
  padding: 12px 36px 12px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card);
  font-size: 14px;
  color: var(--text);
  outline: none;
  cursor: pointer;
  appearance: none;
  -webkit-appearance: none;
  font-family: inherit;
  box-sizing: border-box;
  transition: border-color 0.2s;
}
.setpass-select:focus {
  border-color: var(--accent);
}
.select-wrap::after {
  content: '';
  position: absolute;
  right: 14px;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-left: 5px solid transparent;
  border-right: 5px solid transparent;
  border-top: 6px solid #999;
  pointer-events: none;
}

.setpass-custom-wrap {
  margin-top: 6px;
}

.setpass-pw-wrap {
  position: relative;
}
.setpass-pw {
  padding-right: 44px;
}
.pw-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  padding: 4px;
}

.setpass-error {
  font-size: 12px;
  color: var(--danger);
  margin-top: 2px;
}

/* Buttons */
.setpass-actions {
  padding: 20px 20px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.setpass-btn-save {
  width: 100%;
  padding: 15px;
  border-radius: 14px;
  border: none;
  background: var(--accent);
  color: white;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.setpass-btn-save:active {
  background: #7A6248;
  transform: scale(0.98);
}

.btn-skip {
  width: 100%;
  padding: 13px;
  border-radius: 14px;
  border: 1.5px solid var(--border);
  background: var(--card);
  color: var(--text-light);
  font-size: 14px;
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
}
.btn-skip:active {
  background: var(--bg);
  transform: scale(0.98);
}

.btn-exit {
  width: 100%;
  padding: 12px;
  border-radius: 14px;
  border: none;
  background: transparent;
  color: var(--text-light);
  font-size: 13px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: color 0.2s;
  font-family: inherit;
  margin-top: 4px;
}
.btn-exit:active {
  color: var(--danger);
}

.btn-back-placeholder {
  width: 40px;
  height: 36px;
  flex-shrink: 0;
}
