:root {
  --bg: #0a0a0a;
  --panel: #111113;
  --panel-alt: #0d0d0f;
  --border: #27272a;
  --text: #e4e4e7;
  --dim: #9ca3af;
  --accent: #f59e0b;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', monospace;
}

a { color: inherit; }

.icon-bread {
  flex: none;
  transform: translateY(2px);
}

.wordmark {
  display: flex;
  align-items: center;
  gap: 10px;
}

.wordmark span {
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.divider {
  height: 1px;
  background: var(--border);
  margin: 20px 0;
}

.dim { color: var(--dim); }
.accent { color: var(--accent); }

/* ---- lock screen ---- */

.lock-screen {
  width: 100%;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
}

.lock-card {
  width: 100%;
  max-width: 420px;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  overflow: hidden;
}

.lock-card-body {
  padding: 32px 28px 28px;
}

.status-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
}

.status-block {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

label.field-label {
  display: block;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--dim);
  margin-bottom: 8px;
}

input[type="password"] {
  width: 100%;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 10px 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 14px;
}

input[type="password"]:focus {
  border-color: var(--accent);
  outline: none;
}

input[type="password"]::placeholder {
  color: #52525b;
  letter-spacing: 2px;
}

button.unlock {
  margin-top: 16px;
  display: block;
  width: 100%;
  text-align: center;
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  border-radius: 3px;
  padding: 10px;
  font-size: 13px;
  font-family: inherit;
  letter-spacing: 0.05em;
  cursor: pointer;
  transition: background 0.15s, color 0.15s;
}

button.unlock:hover { background: var(--accent); color: var(--bg); }
button.unlock:disabled { opacity: 0.5; cursor: default; }

.lock-error {
  margin-top: 12px;
  font-size: 12px;
  color: #f87171;
  min-height: 1em;
}

.lock-footer {
  margin-top: 16px;
  text-align: center;
  font-size: 11px;
  color: var(--dim);
}

/* ---- dashboard ---- */

.dashboard {
  width: 100%;
  min-height: 100vh;
  padding: 0 40px 48px;
}

.dashboard-inner {
  max-width: 1120px;
  margin: 0 auto;
}

/* Pinned at the top of the page while only the panel content below it
   scrolls — plain `position: sticky`, no JS, since nothing here needs an
   inner scroll container of its own. */
.dashboard-header {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
  padding-top: 32px;
}

.top-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
}

.top-bar-right {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 13px;
  color: var(--dim);
}

.tabs {
  display: flex;
  gap: 28px;
  border-bottom: 1px solid var(--border);
  margin-top: 24px;
}

.tab {
  background: none;
  border: none;
  font-family: inherit;
  cursor: pointer;
  padding: 0 0 12px 0;
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  border-bottom: 2px solid transparent;
  margin-bottom: -1px;
  color: var(--dim);
}

.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--accent); }

.panel { display: none; padding-top: 24px; }
.panel.active { display: block; }

.video-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 4px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.video-box video { width: 100%; height: 100%; object-fit: cover; }

.video-box .placeholder { color: var(--dim); font-size: 13px; }

.badge-rec {
  position: absolute;
  top: 12px;
  left: 12px;
  font-size: 11px;
  color: var(--accent);
}

.badge-rec.badge-offline { color: var(--dim); }

.caption { margin-top: 12px; font-size: 12px; color: var(--dim); }

.range-pill {
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: 12px;
  color: var(--dim);
  background: none;
  font-family: inherit;
  cursor: pointer;
}

/* ---- gallery ---- */

.gallery-group-label {
  font-size: 12px;
  color: var(--dim);
  margin: 20px 0 10px;
  text-transform: uppercase;
  letter-spacing: 0.06em;
}

.gallery-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 8px;
}

.nc-loadmore {
  display: block;
  width: 100%;
  margin-top: 20px;
  background: none;
  border: 1px solid var(--border);
  color: var(--dim);
  font-family: inherit;
  font-size: 12px;
  padding: 10px;
  border-radius: 4px;
  cursor: pointer;
}
.nc-loadmore:hover { color: var(--text); border-color: #3f3f46; }

.nc-photo {
  position: relative;
  display: block;
  aspect-ratio: 1 / 1;
  width: 100%;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 3px;
  overflow: hidden;
  padding: 0;
  margin: 0;
  cursor: zoom-in;
  font: inherit;
}

.nc-photo img { width: 100%; height: 100%; object-fit: cover; display: block; }
.nc-photo .nc-time { position: absolute; left: 6px; bottom: 6px; font-size: 10px; color: var(--dim); text-shadow: 0 1px 2px #000; }

/* ---- diary ---- */

.diary-layout { display: flex; flex-wrap: wrap; gap: 28px; }
.diary-calendar { flex: 1 1 320px; min-width: 280px; }
.diary-entry { flex: 999 1 360px; min-width: 0; }

.diary-cal-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}

.diary-weekdays {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
  font-size: 10px;
  color: #52525b;
  text-align: center;
  margin-bottom: 4px;
}

.diary-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 4px;
}

.nc-navbtn {
  background: none;
  border: 1px solid var(--border);
  color: var(--dim);
  font-family: inherit;
  font-size: 13px;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  cursor: pointer;
}
.nc-navbtn:hover { color: var(--text); }

.nc-day {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 4px;
  border: 1px solid transparent;
  background: none;
  font-family: inherit;
  color: var(--text);
  cursor: pointer;
  font-size: 13px;
}
.nc-day:hover { background: var(--panel); }
.nc-day:disabled { visibility: hidden; cursor: default; }
.nc-day.selected { border-color: var(--accent); }
.nc-day.today { font-weight: 700; }

.nc-dot {
  position: absolute;
  bottom: 5px;
  left: 50%;
  transform: translateX(-50%);
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--accent);
}

.nc-diary-note {
  width: 100%;
  box-sizing: border-box;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: 3px;
  padding: 12px;
  color: var(--text);
  font-family: inherit;
  font-size: 13px;
  line-height: 1.6;
  resize: vertical;
  scrollbar-color: #3f3f46 transparent;
}
.nc-diary-note:focus { border-color: var(--accent); outline: none; }

.diary-attachments { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }

.nc-attach-wrap { position: relative; width: 64px; height: 64px; flex: none; }
.nc-attach { width: 64px; height: 64px; flex: none; }

.nc-attach-remove {
  position: absolute;
  top: -6px;
  right: -6px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--dim);
  font-size: 12px;
  line-height: 1;
  padding: 0;
  cursor: pointer;
}
.nc-attach-remove:hover { color: #f87171; border-color: #f87171; }

.nc-attach-add {
  position: relative;
  width: 64px;
  height: 64px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px dashed #3f3f46;
  border-radius: 3px;
  background: none;
  color: #52525b;
  font-size: 18px;
  cursor: pointer;
}
.nc-attach-add:hover { border-color: var(--accent); color: var(--accent); }
.nc-attach-add input[type="file"] { position: absolute; width: 1px; height: 1px; opacity: 0; }

.nc-save {
  background: none;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: inherit;
  font-size: 12px;
  padding: 8px 16px;
  border-radius: 3px;
  cursor: pointer;
  margin-top: 10px;
}
.nc-save:hover { background: var(--accent); color: var(--bg); }

#diary-save-status { margin-left: 10px; margin-top: 0; }

/* ---- lightbox ---- */

.nc-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 10, 10, 0.92);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  cursor: zoom-out;
  padding: 48px;
  box-sizing: border-box;
}
.nc-lightbox[hidden] { display: none; }

.nc-lightbox-frame {
  position: relative;
  max-width: 720px;
  max-height: 100%;
  width: 100%;
  aspect-ratio: 4 / 3;
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: 6px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.nc-lightbox-frame img { width: 100%; height: 100%; object-fit: contain; }

.nc-lightbox-caption {
  position: absolute;
  bottom: 14px;
  left: 0;
  right: 0;
  text-align: center;
  font-size: 12px;
  color: var(--dim);
}

.nc-lightbox-close {
  position: absolute;
  top: 14px;
  right: 14px;
  width: 28px;
  height: 28px;
  border-radius: 3px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--dim);
  font-size: 14px;
  cursor: pointer;
}
.nc-lightbox-close:hover { color: var(--text); }

.nc-lightbox-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--dim);
  font-size: 20px;
  cursor: pointer;
  z-index: 1;
}
.nc-lightbox-arrow:hover { color: var(--text); border-color: #3f3f46; }
.nc-lightbox-arrow.prev { left: 16px; }
.nc-lightbox-arrow.next { right: 16px; }
.nc-lightbox-arrow[hidden] { display: none; }
