  :root {
    --bg: #0f0f0f;
    --surface: #1a1a1a;
    --surface-2: #242424;
    --text: #e8e6e3;
    --text-dim: #8a8a8a;
    --accent: #c9a96e;
    --danger: #c96e6e;
    --success: #6ec98a;
    --border: #2e2e2e;
    --shadow: 0 8px 32px rgba(0,0,0,0.5);
  }
  * { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
  html, body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
    background: var(--bg);
    color: var(--text);
    height: 100%;
    overflow: hidden;
    font-size: 16px;
    line-height: 1.5;
  }
  button { font-family: inherit; cursor: pointer; }
  input, textarea { font-family: inherit; }

  .hidden { display: none !important; }

  /* ============================
     LOCK / SETUP
     ============================ */
  #lockScreen {
    position: fixed; inset: 0;
    background: var(--bg);
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    z-index: 100;
    padding: 24px; gap: 20px; overflow-y: auto;
  }
  #lockScreen .brand-icon {
    width: 104px;
    height: 104px;
    border-radius: 24px;
    display: block;
    object-fit: cover;
    margin-bottom: -4px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.35);
  }

  #lockScreen .brand {
    font-size: 1.3rem; font-weight: 400;
    letter-spacing: 0.2em; text-transform: uppercase;
    color: var(--text-dim);
  }
  #lockScreen .sub {
    font-size: 0.8rem; color: var(--text-dim);
    max-width: 300px; text-align: center; line-height: 1.6;
  }
  .pin-display { display: flex; gap: 14px; margin: 8px 0; min-height: 14px; }
  .pin-dot {
    width: 14px; height: 14px; border-radius: 50%;
    border: 1.5px solid var(--text-dim); transition: all 0.15s;
  }
  .pin-dot.filled { background: var(--accent); border-color: var(--accent); transform: scale(1.1); }
  .keypad { display: grid; grid-template-columns: repeat(3, 68px); gap: 14px; }
  .keypad button {
    width: 68px; height: 68px; border-radius: 50%;
    background: var(--surface); border: 1px solid var(--border);
    color: var(--text); font-size: 1.4rem; transition: all 0.15s;
  }
  .keypad button:hover:not(.empty) { background: var(--surface-2); }
  .keypad button:active:not(.empty) { transform: scale(0.92); }
  .keypad button.empty { visibility: hidden; pointer-events: none; }
  #lockError {
    color: var(--danger); font-size: 0.8rem;
    height: 1.2em; opacity: 0; transition: opacity 0.2s; text-align: center;
  }
  #lockError.show { opacity: 1; }
  .hint {
    font-size: 0.7rem; color: var(--text-dim);
    text-align: center; max-width: 320px; line-height: 1.6;
  }
  .hint strong { color: var(--accent); }
  .setup-warning {
    background: rgba(201,110,110,0.08);
    border: 1px solid rgba(201,110,110,0.3);
    border-radius: 8px; padding: 12px 14px;
    font-size: 0.75rem; color: var(--danger);
    max-width: 340px; line-height: 1.6;
  }

  /* ============================
     MAIN APP
     ============================ */
  #app { display: none; height: 100vh; height: 100dvh; flex-direction: column; }
  #app.visible { display: flex; }

  header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 12px 16px; border-bottom: 1px solid var(--border);
    gap: 12px; background: var(--bg); flex-shrink: 0;
  }
  header .title {
    font-size: 0.75rem; letter-spacing: 0.15em;
    text-transform: uppercase; color: var(--text-dim); white-space: nowrap;
  }
  header .actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; justify-content: flex-end; }
  .net-monitor {
    display: flex; align-items: center; gap: 6px;
    font-size: 0.65rem; color: var(--success);
    font-family: ui-monospace, monospace;
    padding: 4px 8px; border: 1px solid rgba(110,201,138,0.25);
    border-radius: 4px; background: rgba(110,201,138,0.05); white-space: nowrap;
  }
  .net-monitor.alert {
    color: var(--danger);
    border-color: rgba(201,110,110,0.4);
    background: rgba(201,110,110,0.08);
  }
  .net-dot {
    width: 6px; height: 6px; border-radius: 50%;
    background: currentColor; animation: pulse 2s infinite; flex-shrink: 0;
  }
  @keyframes pulse { 0%,100%{opacity:1} 50%{opacity:0.3} }
  .icon-btn {
    background: none; border: 1px solid var(--border);
    color: var(--text-dim); cursor: pointer; font-size: 0.7rem;
    padding: 5px 10px; border-radius: 4px; transition: all 0.15s; white-space: nowrap;
  }
  .icon-btn:hover { background: var(--surface); color: var(--text); border-color: var(--text-dim); }

  /* Layout */
  .main { display: flex; flex: 1; overflow: hidden; min-height: 0; }
  .sidebar {
    width: 300px; border-right: 1px solid var(--border);
    display: flex; flex-direction: column;
    background: var(--surface); flex-shrink: 0; min-height: 0;
  }
  .sidebar-header {
    padding: 12px 14px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    gap: 8px; flex-shrink: 0;
  }
  .sidebar-header span {
    font-size: 0.65rem; text-transform: uppercase;
    letter-spacing: 0.1em; color: var(--text-dim);
  }
  .new-btn {
    background: var(--accent); color: #111;
    border: none; padding: 8px 14px; border-radius: 6px;
    font-size: 0.75rem; cursor: pointer; font-weight: 700;
    transition: opacity 0.15s, transform 0.1s;
    letter-spacing: 0.02em;
    box-shadow: 0 2px 8px rgba(201,169,110,0.25);
  }
  .new-btn:hover { opacity: 0.9; }
  .new-btn:active { transform: scale(0.96); }

  /* View tabs */
  .view-tabs {
    display: flex; gap: 0;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
    background: var(--surface);
  }
  .view-tab {
    flex: 1;
    background: none; border: none;
    color: var(--text-dim);
    font-size: 0.7rem;
    padding: 10px 6px;
    cursor: pointer;
    border-bottom: 2px solid transparent;
    transition: all 0.15s;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .view-tab:hover { color: var(--text); background: var(--surface-2); }
  .view-tab.active {
    color: var(--accent);
    border-bottom-color: var(--accent);
  }

  .search-box {
    padding: 8px 12px;
    border-bottom: 1px solid var(--border);
    flex-shrink: 0;
  }
  .search-box input {
    width: 100%; background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text); padding: 7px 10px;
    border-radius: 4px; font-size: 0.75rem; outline: none;
  }
  .search-box input:focus { border-color: var(--accent); }
  .search-box input::placeholder { color: var(--text-dim); }

  .sidebar-body {
    flex: 1; overflow-y: auto; min-height: 0;
  }

  /* Entry list */
  .entry-list { min-height: 0; }
  .entry-item {
    padding: 12px 16px; cursor: pointer;
    border-bottom: 1px solid var(--border);
    transition: background 0.15s;
    border-left: 2px solid transparent;
    display: flex; gap: 10px; align-items: center;
  }
  .entry-item:hover { background: var(--surface-2); }
  .entry-item.active { background: var(--surface-2); border-left-color: var(--accent); }
  .entry-item .thumb {
    width: 40px; height: 40px; border-radius: 6px;
    object-fit: cover; flex-shrink: 0;
    background: var(--surface-2); border: 1px solid var(--border);
  }
  .entry-item .meta { min-width: 0; flex: 1; }
  .entry-item .date {
    font-size: 0.62rem; color: var(--text-dim);
    margin-bottom: 4px; font-family: ui-monospace, monospace;
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .entry-item .preview {
    font-size: 0.82rem; color: var(--text);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  .entry-item .preview.empty { color: var(--text-dim); font-style: italic; }
  .entry-item .badge {
    font-size: 0.6rem; color: var(--accent);
    margin-left: 6px;
  }

  .empty-list {
    padding: 40px 20px; text-align: center;
    color: var(--text-dim); font-size: 0.75rem; line-height: 1.7;
  }

  /* Calendar view */
  .calendar-wrap {
    padding: 14px 12px 20px;
  }
  .cal-header {
    display: flex; justify-content: space-between; align-items: center;
    margin-bottom: 14px; gap: 8px;
  }
  .cal-title {
    font-size: 0.85rem; color: var(--text);
    font-weight: 500;
    letter-spacing: 0.05em;
  }
  .cal-nav {
    display: flex; gap: 6px;
  }
  .cal-nav button {
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); width: 28px; height: 28px;
    border-radius: 6px; font-size: 0.9rem;
    display: flex; align-items: center; justify-content: center;
    transition: background 0.15s;
  }
  .cal-nav button:hover { background: var(--border); }
  .cal-weekdays {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 4px; margin-bottom: 6px;
  }
  .cal-weekdays div {
    text-align: center; font-size: 0.6rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.05em;
    padding: 4px 0;
  }
  .cal-grid {
    display: grid; grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .cal-cell {
    aspect-ratio: 1 / 1;
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-radius: 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 0.75rem; color: var(--text-dim);
    cursor: pointer;
    position: relative;
    transition: background 0.15s, border-color 0.15s;
    user-select: none;
  }
  .cal-cell:hover { background: var(--border); }
  .cal-cell.other-month { opacity: 0.35; }
  .cal-cell.today {
    border-color: var(--accent);
    color: var(--accent);
    font-weight: 700;
  }
  .cal-cell.has-entry {
    background: rgba(201,169,110,0.12);
    color: var(--text);
    border-color: rgba(201,169,110,0.35);
  }
  .cal-cell.selected {
    background: var(--accent);
    color: #111;
    border-color: var(--accent);
    font-weight: 700;
  }
  .cal-cell .dot {
    position: absolute; bottom: 4px;
    width: 4px; height: 4px; border-radius: 50%;
    background: var(--accent);
  }
  .cal-cell.has-photo::after {
    content: '';
    position: absolute; top: 4px; right: 4px;
    width: 5px; height: 5px; border-radius: 50%;
    background: var(--success);
  }

  /* Entries shown below the calendar for the selected date */
  .cal-day-entries {
    margin-top: 16px;
    border-top: 1px solid var(--border);
    padding-top: 14px;
  }
  .cal-day-entries-title {
    font-size: 0.68rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    margin-bottom: 10px;
  }
  .cal-day-entry {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 7px;
    padding: 10px 12px;
    margin-bottom: 8px;
    cursor: pointer;
  }
  .cal-day-entry:hover {
    background: var(--border);
  }
  .cal-day-entry-time {
    font-size: 0.62rem;
    color: var(--accent);
    font-family: ui-monospace, monospace;
    margin-bottom: 4px;
  }
  .cal-day-entry-preview {
    font-size: 0.8rem;
    color: var(--text);
    line-height: 1.45;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .cal-day-entry-preview.empty {
    color: var(--text-dim);
    font-style: italic;
  }
  .cal-day-entry-photo {
    font-size: 0.62rem;
    color: var(--text-dim);
    margin-top: 5px;
  }

  /* On this day */
  .otd-wrap { padding: 14px 14px 20px; }
  .otd-empty {
    padding: 40px 20px; text-align: center;
    color: var(--text-dim); font-size: 0.78rem; line-height: 1.8;
  }
  .otd-card {
    background: var(--surface-2);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    border-radius: 8px;
    padding: 12px 14px;
    margin-bottom: 12px;
    cursor: pointer;
    transition: background 0.15s;
  }
  .otd-card:hover { background: var(--border); }
  .otd-years {
    font-size: 0.65rem; color: var(--accent);
    font-family: ui-monospace, monospace;
    text-transform: uppercase; letter-spacing: 0.08em;
    margin-bottom: 6px;
  }
  .otd-date {
    font-size: 0.7rem; color: var(--text-dim);
    margin-bottom: 6px;
  }
  .otd-preview {
    font-size: 0.82rem; color: var(--text);
    line-height: 1.6;
    display: -webkit-box;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .otd-thumbs {
    display: flex; gap: 4px; margin-top: 8px; flex-wrap: wrap;
  }
  .otd-thumbs img {
    width: 40px; height: 40px; border-radius: 4px;
    object-fit: cover; border: 1px solid var(--border);
  }

  /* ============================
     EDITOR
     ============================ */
  .editor {
    flex: 1; display: flex; flex-direction: column;
    background: var(--bg); min-width: 0; min-height: 0;
  }
  .editor-header {
    padding: 14px 24px; border-bottom: 1px solid var(--border);
    display: flex; justify-content: space-between; align-items: center;
    gap: 12px; flex-shrink: 0; min-height: 52px;
  }
  .editor-date {
    font-size: 0.72rem; color: var(--text-dim);
    font-family: ui-monospace, monospace;
    overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  }
  .editor-actions { display: flex; gap: 8px; flex-shrink: 0; }
  .add-photo-btn, .delete-btn {
    background: none; border: 1px solid var(--border);
    padding: 5px 12px; border-radius: 4px; font-size: 0.7rem;
    transition: background 0.15s;
  }
  .add-photo-btn { color: var(--accent); }
  .add-photo-btn:hover { background: rgba(201,169,110,0.1); }
  .add-photo-btn:disabled { opacity: 0.3; cursor: not-allowed; }
  .delete-btn { color: var(--danger); }
  .delete-btn:hover { background: rgba(201,110,110,0.1); }
  .delete-btn:disabled { opacity: 0.3; cursor: not-allowed; }

  .editor-empty {
    display: none; flex: 1;
    flex-direction: column; align-items: center; justify-content: center;
    gap: 12px; padding: 40px 24px; text-align: center;
  }
  .editor-empty.visible { display: flex; }
  .editor-empty-text { font-size: 0.95rem; color: var(--text-dim); }
  .editor-empty-hint {
    font-size: 0.75rem; color: var(--text-dim);
    max-width: 320px; line-height: 1.7;
  }
  .editor-empty-hint strong { color: var(--accent); }

  .editor-body {
    flex: 1; display: flex; flex-direction: column;
    min-height: 0; overflow-y: auto;
  }
  .photo-strip {
    display: flex; gap: 8px; padding: 12px 24px 0;
    flex-wrap: wrap;
  }
  .photo-strip:empty { display: none; }
  .photo-item {
    position: relative;
    width: 80px; height: 80px;
    border-radius: 8px; overflow: hidden;
    border: 1px solid var(--border);
    background: var(--surface);
  }
  .photo-item img {
    width: 100%; height: 100%; object-fit: cover;
    cursor: pointer;
    display: block;
  }
  .photo-item .remove-photo {
    position: absolute; top: 2px; right: 2px;
    width: 20px; height: 20px; border-radius: 50%;
    background: rgba(0,0,0,0.7); color: var(--danger);
    border: none; font-size: 0.7rem;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; line-height: 1;
  }
  .photo-item .remove-photo:hover { background: rgba(201,110,110,0.3); }

  .editor textarea {
    flex: 1; width: 100%;
    background: transparent; border: none;
    color: var(--text); font-size: 0.95rem;
    line-height: 1.8; padding: 20px 24px;
    resize: none; outline: none;
    min-height: 200px;
    font-family: inherit;
  }
  .editor textarea::placeholder { color: var(--text-dim); }

  .editor-footer {
    padding: 8px 24px; border-top: 1px solid var(--border);
    display: flex; justify-content: space-between;
    font-size: 0.65rem; color: var(--text-dim);
    font-family: ui-monospace, monospace;
    flex-shrink: 0; gap: 12px;
  }
  .saved-indicator {
    color: var(--success); opacity: 0; transition: opacity 0.3s;
    white-space: nowrap;
  }
  .saved-indicator.show { opacity: 1; }

  /* Lightbox */
  #lightbox {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.95);
    display: none; align-items: center; justify-content: center;
    z-index: 400; padding: 20px;
  }
  #lightbox.visible { display: flex; }
  #lightbox img {
    max-width: 100%; max-height: 90vh;
    border-radius: 8px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  }
  #lightbox .close-lb {
    position: absolute; top: 20px; right: 20px;
    background: rgba(255,255,255,0.1);
    border: 1px solid rgba(255,255,255,0.2);
    color: #fff; width: 36px; height: 36px;
    border-radius: 50%; font-size: 1.2rem;
    cursor: pointer;
  }

  /* ============================
     MODALS
     ============================ */
  .modal-overlay {
    position: fixed; inset: 0;
    background: rgba(0,0,0,0.85);
    display: none; align-items: center; justify-content: center;
    z-index: 200; padding: 20px;
    backdrop-filter: blur(4px);
  }
  .modal-overlay.visible { display: flex; }
  .modal-content {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: 12px; max-width: 520px; width: 100%;
    padding: 28px; max-height: 85vh; overflow-y: auto;
    box-shadow: var(--shadow);
  }
  .modal-content h2 { font-size: 1rem; margin-bottom: 16px; font-weight: 500; letter-spacing: 0.05em; }
  .modal-content h3 {
    font-size: 0.8rem; margin: 20px 0 10px;
    font-weight: 500; color: var(--text-dim);
    text-transform: uppercase; letter-spacing: 0.1em;
  }
  .modal-content ul { list-style: none; display: flex; flex-direction: column; gap: 10px; }
  .modal-content li { display: flex; gap: 10px; font-size: 0.8rem; line-height: 1.6; color: var(--text-dim); }
  .modal-content li .mark { flex-shrink: 0; width: 14px; }
  .modal-content li .check { color: var(--success); }
  .modal-content li .cross { color: var(--danger); }
  .modal-content p { font-size: 0.75rem; color: var(--text-dim); line-height: 1.7; margin: 12px 0; }
  .modal-actions { display: flex; gap: 10px; margin-top: 20px; }
  .modal-actions button {
    flex: 1; padding: 10px; border-radius: 6px;
    font-size: 0.8rem; border: 1px solid var(--border);
    background: var(--surface-2); color: var(--text);
    transition: background 0.15s;
  }
  .modal-actions button:hover { background: var(--border); }
  .modal-actions button.primary {
    background: var(--accent); color: #111;
    border-color: var(--accent); font-weight: 600;
  }
  .modal-actions button.primary:hover { opacity: 0.9; }
  .modal-actions button.danger {
    background: rgba(201,110,110,0.15); color: var(--danger);
    border-color: rgba(201,110,110,0.4);
  }
  .modal-actions button.danger:hover { background: rgba(201,110,110,0.25); }

  .menu-list { list-style: none; display: flex; flex-direction: column; gap: 8px; }
  .menu-list li { display: block; }
  .menu-list button {
    width: 100%; text-align: left; padding: 12px 14px;
    font-size: 0.82rem; border-radius: 6px;
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); transition: background 0.15s;
  }
  .menu-list button:hover { background: var(--border); }
  .menu-list button.danger {
    color: var(--danger);
    border-color: rgba(201,110,110,0.3);
    background: rgba(201,110,110,0.06);
  }
  .menu-list button.danger:hover { background: rgba(201,110,110,0.15); }

  .form-group { margin-bottom: 14px; }
  .form-group label {
    display: block; font-size: 0.7rem;
    color: var(--text-dim); margin-bottom: 6px;
    text-transform: uppercase; letter-spacing: 0.05em;
  }
  .form-group input {
    width: 100%; background: var(--bg);
    border: 1px solid var(--border);
    color: var(--text); padding: 10px 12px;
    border-radius: 6px; font-size: 0.9rem;
    outline: none; font-family: ui-monospace, monospace;
    letter-spacing: 0.3em;
  }
  .form-group input:focus { border-color: var(--accent); }
  .form-error { color: var(--danger); font-size: 0.72rem; margin-top: 6px; min-height: 1em; }

  #toast {
    position: fixed; bottom: 24px; left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--surface-2); border: 1px solid var(--border);
    color: var(--text); padding: 10px 20px; border-radius: 8px;
    font-size: 0.8rem; transition: transform 0.3s ease;
    z-index: 300; box-shadow: var(--shadow);
    max-width: 90vw; text-align: center;
  }
  #toast.show { transform: translateX(-50%) translateY(0); }
  #toast.success { border-color: rgba(110,201,138,0.4); }
  #toast.error { border-color: rgba(201,110,110,0.4); color: var(--danger); }

  /* Mobile */
  @media (max-width: 720px) {
    /* Keep the main controls visible on the home/list screen too.
       The sidebar previously covered the header on mobile. */
    header {
      position: relative;
      z-index: 60;
    }
    .sidebar {
      position: absolute;
      top: 54px; right: 0; bottom: 0; left: 0;
      width: 100%; z-index: 50;
      transition: transform 0.25s ease;
    }
    .sidebar.hidden-mobile { transform: translateX(-100%); }
    .editor { width: 100%; }
    header .title { display: none; }
    .editor-header { padding: 12px 16px; }
    .editor textarea { padding: 16px; font-size: 0.95rem; }
    .photo-strip { padding: 12px 16px 0; }
    .editor-footer { padding: 8px 16px; }
    .modal-content { padding: 22px; }
    .keypad { grid-template-columns: repeat(3, 62px); gap: 12px; }
    .keypad button { width: 62px; height: 62px; }
  }

  ::-webkit-scrollbar { width: 6px; height: 6px; }
  ::-webkit-scrollbar-track { background: transparent; }
  ::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }
  ::-webkit-scrollbar-thumb:hover { background: var(--text-dim); }

  @media (prefers-reduced-motion: reduce) {
    * { animation-duration: 0.01ms !important; transition-duration: 0.01ms !important; }
  }


/* ============================================================================
   EXTRACTED FROM ORIGINAL index.html — order preserved intentionally.
   CSS cleanup will be done only after the migrated app is verified.
   ============================================================================ */


.creator-link,
.creator-link:visited,
.creator-link:hover,
.creator-link:active {
  color: #f4b400;
  text-decoration: none;
}

/* ============================================================
   ZOBBIN DIARY — NOTIFICATIONS
   ============================================================ */

.dn-notification-btn {
  position: relative;
  width: 34px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 4px;
  color: var(--text-dim);
  cursor: pointer;
  transition: all 0.15s ease;
  flex-shrink: 0;
}

.dn-notification-btn:hover {
  background: var(--surface);
  color: var(--text);
  border-color: var(--text-dim);
}

.dn-notification-btn:active {
  transform: scale(0.95);
}

.dn-notification-btn svg {
  width: 17px;
  height: 17px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.dn-notification-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--danger);
  color: #fff;
  border: 2px solid var(--bg);
  border-radius: 999px;
  font-size: 0.55rem;
  font-weight: 700;
  line-height: 1;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
}

.dn-notification-badge[hidden] {
  display: none !important;
}

.dn-owner-notification-modal {
  position: fixed;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  z-index: 250;
}

.dn-owner-notification-modal.visible {
  display: flex;
}

.dn-owner-notification-card {
  width: 100%;
  max-width: 520px;
  max-height: 85vh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.dn-owner-notification-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 20px;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}

.dn-owner-notification-head h2 {
  margin: 0;
  font-size: 1rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  color: var(--text);
}

.dn-owner-notification-head .close {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  background: none;
  border: 1px solid var(--border);
  border-radius: 6px;
  color: var(--text-dim);
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
  transition: all 0.15s ease;
}

.dn-owner-notification-head .close:hover {
  background: var(--surface-2);
  color: var(--text);
  border-color: var(--text-dim);
}

.dn-owner-notification-list {
  flex: 1;
  overflow-y: auto;
  padding: 10px;
  min-height: 0;
}

.dn-owner-notification-loading,
.dn-owner-notification-empty {
  padding: 40px 20px;
  text-align: center;
  color: var(--text-dim);
  font-size: 0.78rem;
  line-height: 1.7;
}

.dn-owner-notification-item {
  position: relative;
  padding: 14px 14px 13px;
  margin-bottom: 8px;
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: 8px;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.dn-owner-notification-item:last-child {
  margin-bottom: 0;
}

.dn-owner-notification-item:hover {
  background: var(--border);
}

.dn-owner-notification-item.unread {
  border-color: rgba(201, 169, 110, 0.35);
  background: rgba(201, 169, 110, 0.07);
}

.dn-owner-notification-item.unread::before {
  content: "";
  position: absolute;
  top: 15px;
  left: 7px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}

.dn-owner-notification-item h3 {
  margin: 0 0 6px;
  padding-left: 4px;
  color: var(--text);
  font-size: 0.82rem;
  font-weight: 600;
  line-height: 1.4;
}

.dn-owner-notification-item p {
  margin: 0 0 8px;
  color: var(--text-dim);
  font-size: 0.75rem;
  line-height: 1.65;
}

.dn-owner-notification-date {
  display: block;
  color: var(--text-dim);
  font-size: 0.62rem;
  font-family: ui-monospace, monospace;
  opacity: 0.8;
}

.dn-owner-notification-item a {
  display: inline-block;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.72rem;
  text-decoration: none;
}

.dn-owner-notification-item a:hover {
  text-decoration: underline;
}

@media (max-width: 720px) {
  .dn-notification-btn {
    width: 34px;
    height: 32px;
  }

  .dn-owner-notification-modal {
    align-items: flex-end;
    padding: 0;
  }

  .dn-owner-notification-card {
    max-width: none;
    width: 100%;
    max-height: 82vh;
    border-radius: 14px 14px 0 0;
    border-bottom: none;
  }

  .dn-owner-notification-head {
    padding: 16px 18px;
  }

  .dn-owner-notification-list {
    padding: 10px 12px 16px;
  }

  .dn-owner-notification-item {
    padding: 13px 13px 12px;
  }
}
/* ============================================================
   NOTIFICATION BUTTON — RIGHT SIDE NEXT TO LOCK
   ============================================================ */

header .actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

header .actions .dn-notification-btn {
  order: 999;
  position: relative;

  width: 34px;
  min-width: 34px;
  height: 32px;
  min-height: 32px;

  flex: 0 0 34px;

  display: inline-flex;
  align-items: center;
  justify-content: center;

  padding: 0;
  margin: 0;

  box-sizing: border-box;

  background: transparent;
  border: 1px solid var(--border);
  border-radius: 4px;

  color: var(--text-dim);
}

header .actions .dn-notification-btn svg {
  width: 17px;
  height: 17px;

  display: block;

  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

header .actions .dn-notification-btn:hover {
  background: var(--surface);
  color: var(--text);
}

header .actions .dn-notification-btn:active {
  transform: scale(0.95);
}