:root {
  color-scheme: light;
  --bg: #f7f8fa;
  --surface: #ffffff;
  --surface-soft: #f2f5f3;
  --ink: #20231f;
  --muted: #68706b;
  --line: #dce3de;
  --accent: #28705d;
  --accent-strong: #165341;
  --accent-soft: #e6f2ed;
  --album: #b45f2a;
  --notice: #37669c;
  --danger: #9b3434;
  --shadow: 0 16px 40px rgba(25, 32, 28, .08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}

button,
input,
select,
a {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: 248px minmax(0, 1fr);
}

.locked .app-shell {
  display: none;
}

.passcode-screen {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}

body:not(.locked) .passcode-screen {
  display: none;
}

.passcode-card {
  width: min(100%, 360px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  padding: 28px;
  display: grid;
  gap: 12px;
}

.passcode-mark {
  width: 42px;
  height: 42px;
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  display: grid;
  place-items: center;
  font-size: 19px;
  font-weight: 800;
  line-height: 1;
}

.passcode-card h1 {
  margin: 0 0 8px;
  font-size: 22px;
}

.passcode-label {
  color: var(--muted);
  font-size: 14px;
}

.passcode-card input {
  width: 100%;
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  letter-spacing: .18em;
}

.passcode-card input:focus {
  border-color: var(--accent);
  outline: 3px solid var(--accent-soft);
}

.passcode-hint {
  margin: -4px 0 2px;
  color: var(--muted);
  font-size: 13px;
}

.passcode-submit {
  min-height: 46px;
  border: 1px solid var(--accent);
  border-radius: 8px;
  background: var(--accent);
  color: #fff;
  font-weight: 720;
}

.passcode-message {
  min-height: 22px;
  margin: 0;
  color: var(--danger);
  font-size: 14px;
}

.sidebar {
  position: sticky;
  top: 0;
  height: 100vh;
  align-self: start;
  display: flex;
  flex-direction: column;
  border-right: 1px solid var(--line);
  background: var(--surface);
  z-index: 20;
}

.sidebar-header {
  min-height: 72px;
  padding: 14px 18px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
}

.profile {
  min-height: 226px;
  padding: 28px 24px 24px;
  border-bottom: 1px solid var(--line);
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  text-align: center;
}

.profile-photo {
  width: 88px;
  height: 88px;
  padding: 0;
  border: 3px solid #fff;
  border-radius: 50%;
  background: var(--surface-soft);
  box-shadow: 0 0 0 1px var(--line), 0 10px 24px rgba(32, 35, 31, .14);
  overflow: hidden;
  cursor: zoom-in;
  transition: box-shadow .18s ease, transform .18s ease;
}

.profile-photo:hover {
  box-shadow: 0 0 0 2px rgba(40, 112, 93, .24), 0 12px 26px rgba(32, 35, 31, .16);
  transform: translateY(-1px);
}

.profile-photo:focus-visible {
  outline: 3px solid rgba(40, 112, 93, .3);
  outline-offset: 3px;
}

.profile-photo img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: 35% 42%;
  transform: scale(2.35);
  transform-origin: 35% 42%;
}

.profile-copy h1 {
  margin: 0;
  font-size: 20px;
  line-height: 1.3;
}

.profile-copy p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.profile-copy p span {
  margin: 0 6px;
  color: var(--line);
}

.profile-copy strong {
  color: var(--accent);
  font-weight: 760;
}

.sidebar-footer {
  margin-top: auto;
  padding: 18px 20px 22px;
  border-top: 1px solid var(--line);
}

.sidebar-brand {
  display: grid;
  grid-template-columns: 36px minmax(0, 1fr);
  align-items: center;
  gap: 10px;
  min-width: 0;
  margin: 0;
  color: var(--ink);
}

.sidebar-brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  line-height: 1;
  box-shadow: 0 6px 14px rgba(40, 112, 93, .2);
}

.sidebar-brand-copy {
  min-width: 0;
  display: grid;
  gap: 1px;
}

.sidebar-brand-copy strong {
  font-size: 16px;
  font-weight: 800;
  line-height: 1.25;
  white-space: nowrap;
}

.sidebar-brand-copy strong span {
  color: var(--accent);
}

.sidebar-brand-copy small {
  color: var(--muted);
  font-size: 11px;
  font-weight: 650;
  line-height: 1.3;
}

.sync-meta {
  color: var(--muted);
  font-size: 12px;
  line-height: 1.45;
}

.filter-toggle-button {
  min-height: 34px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--muted);
  padding: 0 12px;
  font-size: 13px;
  white-space: nowrap;
}

.filter-toggle-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.workspace {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 34px 40px 56px;
}

.content-header {
  min-height: 64px;
  margin-bottom: 18px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
}

.content-eyebrow {
  margin: 0 0 3px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 720;
}

.content-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.25;
}

.tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) minmax(150px, 190px) auto;
  gap: 10px;
  margin-bottom: 14px;
}

.tools[hidden] {
  display: none;
}

.search-box {
  display: grid;
  grid-template-columns: 32px minmax(0, 1fr);
  align-items: center;
  min-height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  overflow: hidden;
}

.search-icon {
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 20px;
}

.search-box input,
.tools select,
.clear-button {
  min-height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--ink);
  border-radius: 8px;
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 0 12px 0 0;
}

.tools select {
  padding: 0 12px;
}

.clear-button {
  padding: 0 14px;
  color: var(--muted);
}

.clear-button:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.tabs {
  display: grid;
  gap: 4px;
  padding: 20px 14px;
}

.tab {
  position: relative;
  width: 100%;
  min-height: 48px;
  border: 0;
  background: transparent;
  color: var(--muted);
  text-decoration: none;
  border-radius: 7px;
  padding: 8px 10px;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  text-align: left;
  cursor: pointer;
}

.tab:hover {
  background: var(--surface-soft);
  color: var(--ink);
}

.tab:focus-visible {
  outline: 3px solid var(--accent-soft);
}

.tab[aria-selected="true"],
.tab[aria-current="page"] {
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-weight: 720;
}

.tab-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: grid;
  place-items: center;
  background: #e8f1fb;
  color: var(--notice);
  font-size: 17px;
  line-height: 1;
}

.tab-icon img {
  width: 18px;
  height: 18px;
  display: block;
}

.tab[data-type="home"] .tab-icon,
.tab[href*="type=home"] .tab-icon {
  background: var(--accent-soft);
  color: var(--accent);
}

.tab[data-type="album"] .tab-icon,
.tab[href*="type=album"] .tab-icon {
  background: #fff0e6;
  color: var(--album);
}

.tab[data-type="announcement"] .tab-icon,
.tab[href*="type=announcement"] .tab-icon {
  background: #fdebea;
  color: #b84b46;
}

.tab-label {
  min-width: 0;
}

.tab-meta {
  display: inline-flex;
  align-items: center;
  justify-content: flex-end;
  gap: 7px;
}

.tab-count {
  color: var(--muted);
  font-size: 12px;
  font-weight: 650;
}

.tab-new-count {
  display: grid;
  place-items: center;
  min-width: 21px;
  height: 21px;
  padding: 0 6px;
  border: 0;
  border-radius: 999px;
  background: #d9342b;
  color: #fff;
  font-size: 12px;
  font-weight: 820;
  line-height: 1;
  box-shadow: none;
}

.dashboard-grid {
  display: grid;
  grid-template-columns: minmax(0, 900px);
  justify-content: start;
  gap: 18px;
  align-items: start;
}

.app-shell.is-detail-route .dashboard-grid {
  grid-template-columns: minmax(0, 960px);
}

.list-panel,
.detail-panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.panel-head {
  min-height: 54px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.panel-toggle {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.panel-toggle:hover {
  background: var(--surface-soft);
}

.panel-toggle:focus-visible {
  outline: 3px solid var(--accent-soft);
  outline-offset: -3px;
}

.panel-title {
  margin: 0;
  font-size: 16px;
  font-weight: 760;
}

.panel-head-right {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.panel-meta {
  color: var(--muted);
  font-size: 14px;
  white-space: nowrap;
}

.panel-chevron {
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
}

.entry-list {
  display: grid;
}

.entry-list[hidden] {
  display: none;
}

.entry {
  width: 100%;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: inherit;
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: 12px;
  padding: 13px 14px;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.entry:hover {
  background: var(--accent-soft);
}

.entry:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.entry-thumb {
  width: 60px;
  height: 60px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: var(--surface-soft) center / cover no-repeat;
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 13px;
  overflow: hidden;
}

.entry-kicker {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  margin-bottom: 3px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 22px;
  border-radius: 999px;
  padding: 2px 8px;
  color: #fff;
  background: var(--notice);
  font-size: 12px;
  font-weight: 720;
}

.badge.album {
  background: var(--album);
}

.badge.announcement {
  background: var(--accent);
}

.new-pill {
  display: inline-flex;
  align-items: center;
  min-height: 20px;
  border-radius: 999px;
  padding: 1px 7px;
  background: #d9342b;
  color: #fff;
  font-size: 11px;
  font-weight: 820;
  line-height: 1;
}

.entry-title {
  display: block;
  font-size: 15px;
  font-weight: 720;
  line-height: 1.4;
  overflow-wrap: anywhere;
}

.entry-summary {
  display: -webkit-box;
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-body {
  padding: 20px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  margin-bottom: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0 12px;
  background: var(--surface);
  color: var(--accent);
  text-decoration: none;
  font-size: 14px;
  font-weight: 720;
}

.detail-back:hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.detail-back:focus-visible {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.detail-title {
  margin: 0 0 8px;
  font-size: 22px;
  line-height: 1.35;
  overflow-wrap: anywhere;
}

.detail-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

.detail-content {
  border-top: 1px solid var(--line);
  padding-top: 18px;
}

.detail-content img,
.detail-content video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}

.detail-content figure {
  margin: 18px 0;
}

.detail-content figure.is-lightbox-source {
  cursor: zoom-in;
}

.detail-content figure.is-lightbox-source img {
  transition: opacity 0.16s ease, transform 0.16s ease;
}

@media (hover: hover) {
  .detail-content figure.is-lightbox-source:hover img {
    opacity: 0.9;
    transform: scale(0.995);
  }
}

.detail-content figure.is-lightbox-source:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
  border-radius: 10px;
}

.detail-content figcaption {
  color: var(--muted);
  font-size: 14px;
  margin-top: 8px;
}

.detail-content blockquote,
.detail-content .kidsnote-callout {
  border-left: 4px solid var(--accent);
  margin: 16px 0;
  padding: 8px 14px;
  background: var(--surface-soft);
}

.post-nav {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.post-nav-button {
  min-height: 58px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink);
  padding: 10px 12px;
  text-align: left;
  display: grid;
  gap: 4px;
  text-decoration: none;
}

.post-nav-button:not(.is-disabled):hover {
  border-color: var(--accent);
  background: var(--surface-soft);
}

.post-nav-button:focus-visible {
  outline: 3px solid var(--accent-soft);
  border-color: var(--accent);
}

.post-nav-button.is-disabled {
  color: var(--muted);
  opacity: .55;
}

.post-nav-button.next {
  text-align: right;
  justify-items: end;
}

.post-nav-label {
  color: var(--muted);
  font-size: 13px;
  font-weight: 720;
}

.post-nav-title {
  width: 100%;
  font-size: 14px;
  font-weight: 720;
  line-height: 1.35;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.album-gallery {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(128px, 1fr));
  gap: 8px;
  margin: 0 0 18px;
}

.gallery-item {
  position: relative;
  border: 0;
  border-radius: 8px;
  aspect-ratio: 1;
  background: var(--surface-soft) center / cover no-repeat;
  overflow: hidden;
}

.gallery-item:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.gallery-count {
  color: var(--muted);
  font-size: 14px;
  margin: 0 0 10px;
}

.is-gallery-source {
  display: none;
}

.empty,
.error {
  padding: 24px 18px;
}

.empty {
  color: var(--muted);
}

.error {
  color: var(--danger);
}

.lightbox[hidden] {
  display: none;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 50;
  background: rgba(10, 12, 11, .88);
  display: grid;
  grid-template-columns: 64px minmax(0, 1fr) 64px;
  grid-template-rows: 54px minmax(0, 1fr);
  align-items: center;
  gap: 8px;
  padding: 12px;
}

.lightbox-frame {
  grid-column: 2;
  grid-row: 2;
  margin: 0;
  min-width: 0;
  min-height: 0;
  height: 100%;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  justify-items: center;
  gap: 10px;
}

.lightbox-image-wrap {
  width: 100%;
  min-width: 0;
  min-height: 0;
  overflow: auto;
  overscroll-behavior: contain;
  display: flex;
  align-items: center;
  justify-content: center;
}

.lightbox-image-wrap.is-zoomed {
  align-items: flex-start;
  justify-content: flex-start;
  cursor: grab;
  touch-action: none;
}

.lightbox-image-wrap img {
  display: block;
  max-width: 100%;
  max-height: 100%;
  border-radius: 8px;
  object-fit: contain;
  user-select: none;
  -webkit-user-drag: none;
}

.lightbox-image-wrap.is-zoomed img {
  max-width: none;
  max-height: none;
  cursor: inherit;
}

.lightbox-image-wrap.is-dragging,
.lightbox-image-wrap.is-dragging img {
  cursor: grabbing;
}

.lightbox-frame figcaption {
  color: #fff;
  font-size: 14px;
  min-height: 22px;
  text-align: center;
}

.lightbox button {
  border: 0;
  color: #fff;
  background: rgba(255, 255, 255, .12);
  border-radius: 8px;
}

.lightbox button:disabled {
  cursor: default;
  opacity: .38;
}

.lightbox-top-actions {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  display: flex;
  gap: 6px;
}

.lightbox-top-actions button {
  width: 42px;
  height: 42px;
}

.lightbox-download {
  font-size: 22px;
  font-weight: 760;
}

.lightbox-close {
  font-size: 24px;
}

.lightbox-toolbar {
  grid-column: 2;
  grid-row: 1;
  justify-self: center;
  align-self: center;
  display: flex;
  gap: 6px;
  padding: 4px;
  border-radius: 8px;
  background: rgba(255, 255, 255, .08);
}

.lightbox-toolbar button {
  min-width: 40px;
  height: 36px;
  padding: 0 12px;
  font-size: 18px;
  font-weight: 760;
}

.lightbox-toolbar .lightbox-zoom-reset {
  min-width: 66px;
  font-size: 14px;
}

.lightbox-nav {
  grid-row: 2;
  width: 48px;
  height: 64px;
  font-size: 38px;
}

.lightbox-prev {
  grid-column: 1;
}

.lightbox-next {
  grid-column: 3;
}

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .sidebar {
    position: static;
    height: auto;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    box-shadow: 0 6px 20px rgba(25, 32, 28, .06);
  }

  .profile {
    min-height: 78px;
    padding: 10px 16px 8px;
    border-bottom: 0;
    display: flex;
    justify-content: flex-start;
    gap: 12px;
    text-align: left;
  }

  .sidebar-header {
    min-height: 64px;
    padding: 12px 16px;
  }

  .profile-photo {
    width: 54px;
    height: 54px;
    border-width: 2px;
    flex: 0 0 auto;
  }

  .profile-copy h1 {
    font-size: 17px;
  }

  .profile-copy p {
    margin-top: 2px;
    font-size: 12px;
  }

  .sidebar-footer {
    display: none;
  }

  .tabs {
    grid-template-columns: repeat(4, minmax(76px, 1fr));
    gap: 4px;
    padding: 0 10px 10px;
    overflow-x: auto;
  }

  .tab {
    min-height: 42px;
    grid-template-columns: 24px minmax(0, 1fr);
    gap: 6px;
    padding: 6px 8px;
  }

  .tab-icon {
    width: 24px;
    height: 24px;
    border-radius: 6px;
    font-size: 14px;
  }

  .tab-count {
    display: none;
  }

  .tab-new-count {
    position: absolute;
    top: -3px;
    right: -2px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border: 2px solid #fff;
    font-size: 10px;
  }

  .workspace {
    width: 100%;
    padding: 20px 12px 40px;
  }

  .content-header {
    min-height: 52px;
    margin-bottom: 14px;
    align-items: center;
  }

  .content-title {
    font-size: 22px;
  }

  .content-eyebrow {
    font-size: 12px;
  }

  .tools,
  .dashboard-grid {
    grid-template-columns: 1fr;
  }

  .detail-title {
    font-size: 20px;
  }

  .post-nav {
    grid-template-columns: 1fr;
  }

  .post-nav-button.next {
    text-align: left;
    justify-items: start;
  }

  .lightbox {
    grid-template-columns: 44px minmax(0, 1fr) 44px;
    padding: 8px;
  }

  .lightbox-toolbar button {
    min-width: 38px;
    height: 34px;
    padding: 0 10px;
  }
}

@media (max-width: 430px) {
  .tab {
    justify-items: center;
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 6px 4px;
    font-size: 12px;
    text-align: center;
  }

  .tab-icon {
    display: grid;
  }

  .tab-meta {
    position: absolute;
    inset: 0;
    pointer-events: none;
  }

  .content-header {
    align-items: flex-end;
  }

  .filter-toggle-button {
    padding: 0 10px;
  }
}
