.journal,
.j-detail,
.j-editor {
  min-width: 0;
}
.journal .screen-title {
  flex-wrap: wrap;
}
.j-moment-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  max-width: 100%;
}
.j-moment-actions > .primary { flex-shrink: 0; }
.j-moment-actions > .filter-control { min-width: 0; }
.journal > .j-chips {
  width: fit-content;
  max-width: 100%;
  margin: 2px 0 18px;
  padding: 3px;
  border-radius: 24px;
  background: var(--paper);
  border: 1px solid var(--line);
}
.j-upcoming {
  display: grid;
  gap: 18px;
}
.j-upcoming > section {
  padding: 16px clamp(15px, 3vw, 26px) 4px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--paper);
}
.j-upcoming h2 {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
  font: 500 1.48rem/1.3 var(--serif);
}
.j-upcoming h2 small {
  font: 500 0.82rem var(--sans);
  color: var(--muted);
}
.j-upcoming .j-agenda-row {
  align-items: baseline;
  padding-block: 13px;
  border-color: var(--line);
}
.j-upcoming .j-agenda-row:last-child {
  border-bottom: 0;
}
.j-upcoming > .btn {
  justify-self: start;
}
.j-upcoming .j-agenda-time {
  padding: 4px 8px;
  border-radius: 9px;
  background: var(--duo-peach, var(--soft));
  color: var(--ink);
}
.j-upcoming section:nth-child(3n + 2) .j-agenda-time {
  background: var(--duo-lilac, var(--soft));
}
.j-upcoming section:nth-child(3n) .j-agenda-time {
  background: var(--duo-mint, var(--soft));
}
.j-plan-date-row,
.j-moment-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px 8px;
}
.j-plan-picker {
  min-height: 44px;
  border-radius: 24px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 14px;
  color: var(--ink);
  background: var(--duo-lilac, var(--soft));
  overflow: hidden;
  cursor: pointer;
  position: relative;
}
.j-plan-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.j-plan-picker:focus-within,
.j-gallery-track:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.j-plan-date-row .icon-btn {
  min-width: 44px;
  min-height: 44px;
}
.j-moment-actions .j-audience {
  margin-inline-start: auto;
}
.j-audience > span {
  position: absolute;
  clip-path: inset(50%);
  width: 1px;
  height: 1px;
  overflow: hidden;
}
.j-audience select {
  width: auto;
  min-height: 44px;
  border-radius: 16px;
  color: var(--muted);
}
.j-ideas {
  margin-block: 10px 20px;
}
.j-ideas h2 {
  font: 500 1.5rem/1.3 var(--serif);
  margin-bottom: 8px;
}
.j-idea-list {
  display: grid;
  gap: 6px;
}
.j-idea {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 2px 8px 2px 13px;
  border-radius: 16px;
  background: var(--duo-mint, var(--soft));
}
.j-idea-title {
  flex: 1;
  text-align: left;
  min-width: 0;
  min-height: 44px;
  font-weight: 600;
  overflow-wrap: anywhere;
}
.j-idea .icon-btn {
  flex: none;
  width: 44px;
  height: 44px;
}
.j-gallery {
  min-width: 0;
}
.j-gallery-track {
  display: flex;
  align-items: flex-start;
  width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  overscroll-behavior-x: contain;
  border-radius: 12px;
}
.j-gallery-track > figure {
  flex: 0 0 100%;
  width: 100%;
  scroll-snap-align: start;
}
.j-gallery-track > figure:not(.is-current) {
  height: 0;
}
.j-gallery-track .j-asset img {
  width: 100%;
  height: auto;
  max-height: min(54dvh, 480px);
  aspect-ratio: auto 4 / 3;
  object-fit: contain;
}
.j-gallery-nav {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 10px;
  min-height: 44px;
}
.j-gallery-count {
  font-variant-numeric: tabular-nums;
  color: var(--muted);
  font-size: 0.875rem;
}
.j-gallery-nav .icon-btn {
  min-width: 44px;
  min-height: 44px;
}
.j-gallery-nav .icon-btn[aria-disabled="true"] {
  opacity: 0.45;
}
.j-memory-card.has-photo {
  position: relative;
}
.j-photo-count {
  position: absolute;
  top: 8px;
  right: 8px;
  display: flex;
  gap: 4px;
  align-items: center;
  border-radius: 10px;
  padding: 3px 7px;
  color: #fff;
  background: #332a30dc;
  font-size: 0.8rem;
}
.j-photo-picker {
  justify-self: start;
  position: relative;
  overflow: hidden;
  background: var(--duo-peach, var(--soft));
  color: var(--ink);
}
.j-photo-picker input {
  position: absolute;
  inset: 0;
  opacity: 0;
  cursor: pointer;
}
.j-photo-picker:focus-within {
  outline: 3px solid var(--accent);
  outline-offset: 3px;
}
.j-picked-photo {
  display: block;
  width: 82px;
  height: 82px;
  object-fit: cover;
  border-radius: 11px;
}
.j-picked-photos {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.j-picked-frame {
  position: relative;
}
.j-picked-frame .icon-btn {
  position: absolute;
  top: 0;
  right: 0;
  width: 44px;
  height: 44px;
  background: radial-gradient(circle, #322930dc 40%, transparent 43%);
  color: #fff;
}
.j-pending-files:empty,
.j-relations:empty {
  display: none;
}
.j-file-line > span {
  overflow-wrap: anywhere;
}
.j-tools-menu {
  margin-top: 16px;
}
.j-tools-menu summary {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding-inline: 4px;
  color: var(--muted);
  font-weight: 600;
  cursor: pointer;
}
.j-tools-menu[open] > summary svg {
  transform: rotate(180deg);
}
.j-tools-menu .j-tools {
  margin: 0;
  padding: 0;
  border: 0;
}
.j-detail-actions .j-tools-menu {
  margin: 0;
}
.j-detail-actions .j-tools-menu[open] {
  flex-basis: 100%;
}
.j-calendar-layout {
  display: grid;
  grid-template-columns: minmax(320px, 1.3fr) minmax(210px, 0.85fr);
  gap: clamp(16px, 3vw, 36px);
  align-items: start;
}
.j-calendar-panel {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 17px;
  background: var(--paper);
  padding: clamp(15px, 2.2vw, 27px);
}
.j-month-head,
.j-cal-foot,
.j-month-arrows,
.j-pager,
.j-tools,
.j-detail-actions,
.j-editor-actions,
.j-info,
.j-chips,
.j-tags,
.j-inline {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
}
.j-month-head,
.j-cal-foot {
  justify-content: space-between;
}
.j-month-head {
  flex-wrap: nowrap;
  gap: 5px;
}
.j-month-arrows {
  gap: 0;
  flex-wrap: nowrap;
}
.j-month-name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  position: relative;
  min-height: 44px;
  cursor: pointer;
}
.j-month-name h2 {
  font-size: clamp(1.5rem, 3.2vw, 2.45rem);
  line-height: 1.15;
}
.j-month-name h2::first-letter,
.j-agenda-heading h2::first-letter,
.j-film-month h2::first-letter {
  text-transform: uppercase;
}
.j-month-name input {
  position: absolute;
  inset: 0;
  width: 100%;
  max-width: 100%;
  opacity: 0;
  cursor: pointer;
}
.j-month-name:focus-within {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}
.j-calendar-panel .icon-btn,
.j-file-line .icon-btn {
  min-width: 44px;
  min-height: 44px;
}
.j-weekdays,
.j-days {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  text-align: center;
}
.j-weekdays {
  color: var(--muted);
  padding: 14px 0 7px;
  font-size: 0.77rem;
  font-weight: 600;
}
.j-day {
  position: relative;
  width: 100%;
  min-width: 0;
  min-height: 45px;
  padding: 3px 0 5px;
  border-radius: 10px;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.j-day.j-other-month {
  color: var(--muted);
  text-decoration: underline dotted var(--line);
  text-underline-offset: 4px;
}
.j-day[aria-current="date"] span {
  border-bottom: 1px solid currentColor;
}
.j-day[aria-pressed="true"] {
  color: var(--accent-on);
  background: var(--accent);
  font-weight: 600;
}
.j-day i {
  display: block;
  position: absolute;
  left: calc(50% - 2px);
  bottom: 5px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: currentColor;
}
.j-cal-foot {
  border-top: 1px solid var(--line);
  margin-top: 13px;
  padding-top: 12px;
}
.j-download {
  text-decoration: none;
}
.j-agenda {
  min-width: 0;
  padding: 5px 0;
}
.j-agenda-heading {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 6px 0 18px;
  border-bottom: 1px solid var(--line);
}
.j-date-numeral {
  font: 400 clamp(3.5rem, 7vw, 5.4rem)/0.92 var(--serif);
  letter-spacing: -0.08em;
  color: var(--accent);
}
.j-agenda-heading h2 {
  font-size: 1.65rem;
  line-height: 1.18;
}
.j-agenda-heading div > span,
.j-muted,
.j-draft {
  color: var(--muted);
}
.j-agenda-heading div > span {
  font-size: 0.85rem;
}
.j-agenda-empty {
  display: grid;
  justify-items: start;
  gap: 14px;
  padding: 22px 0;
}
.j-agenda-empty p {
  color: var(--muted);
}
.j-agenda-row {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  width: 100%;
  padding: 17px 2px;
  gap: 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.j-agenda-row strong,
.j-agenda-row small {
  display: block;
}
.j-agenda-time {
  color: var(--accent);
  max-width: 11em;
  white-space: normal;
  font-size: 0.8rem;
  font-weight: 600;
  padding-top: 2px;
}
.j-plan-span {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 4px 12px;
  font-size: 0.88rem;
}
.j-plan-span span {
  color: var(--muted);
}
.j-plan-span .btn {
  min-height: 44px;
}
.j-pager {
  justify-content: center;
  margin-top: 15px;
  color: var(--muted);
}
.j-tools {
  margin-top: 22px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
}
.j-subtle {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}
.j-chips {
  gap: 5px;
}
.j-chip {
  min-height: 44px;
  padding: 8px 13px;
  border-radius: 22px;
  color: var(--muted);
  font-size: 0.875rem;
}
.j-chip[aria-pressed="true"] {
  background: var(--soft);
  color: var(--ink);
  font-weight: 600;
}
.j-editor-details summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 8px;
  color: var(--ink);
  cursor: pointer;
}
.j-film-month {
  margin: 20px 0;
}
.j-film-month h2 {
  margin: 0 0 12px;
  font-size: 1.55rem;
}
.j-memory-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(200px, 100%), 1fr));
  gap: 14px;
  align-items: stretch;
}
.j-memory-card {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  text-align: left;
  min-width: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--paper);
  border-radius: 19px;
  padding: 0;
}
.j-memory-card img {
  width: 100%;
  aspect-ratio: 1.35;
  object-fit: cover;
}
.j-memory-card:not(.has-photo) {
  background: var(--duo-lilac, var(--soft));
}
.j-memory-card:not(.has-photo):nth-child(3n + 2) {
  background: var(--duo-peach, var(--soft));
}
.j-memory-card:not(.has-photo):nth-child(3n) {
  background: var(--duo-mint, var(--soft));
}
.j-note-icon {
  padding: 17px 17px 0;
  color: var(--accent);
}
.j-memory-copy {
  display: grid;
  align-content: start;
  padding: 14px 16px 18px;
  gap: 5px;
  overflow-wrap: anywhere;
}
.j-memory-copy small {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}
.j-memory-copy strong,
.j-envelope-words strong {
  font: 400 1.35rem/1.19 var(--serif);
  color: var(--ink);
}
.j-memory-copy p,
.j-envelope-words > span {
  font-size: 0.875rem;
  line-height: 1.49;
  color: var(--muted);
}
.j-letters {
  display: grid;
  margin-top: 14px;
}
.j-envelope {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  width: 100%;
  align-items: center;
  gap: 15px;
  padding: 18px 0;
  text-align: left;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
}
.j-envelope-icon {
  width: 47px;
  height: 47px;
  display: grid;
  place-items: center;
  background: var(--soft);
  color: var(--accent);
  border-radius: 50%;
}
.j-envelope-words {
  display: grid;
  gap: 3px;
}
.j-envelope-date {
  color: var(--muted);
  font-size: 0.8rem;
}
.j-detail {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 17px;
}
.j-detail-heading {
  display: grid;
  justify-items: start;
  gap: 4px;
}
.j-detail-heading > svg {
  color: var(--accent);
}
.j-detail-heading h3 {
  font: 400 clamp(1.7rem, 4vw, 2.5rem)/1.12 var(--serif);
  letter-spacing: -0.035em;
}
.j-info span,
.j-tags span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 0.83rem;
  padding: 4px 9px;
  border-radius: 6px;
  background: var(--soft);
  color: var(--ink);
}
.j-prose {
  white-space: pre-wrap;
  line-height: 1.65;
  overflow-wrap: anywhere;
}
.j-letter-page .j-prose {
  font: 400 1.28rem/1.53 var(--serif);
}
.j-checks {
  display: grid;
  gap: 4px;
}
.j-toggle {
  display: flex;
  align-items: center;
  min-height: 44px;
  gap: 10px;
  cursor: pointer;
}
.j-toggle input[type="checkbox"] {
  width: 19px;
  height: 19px;
  flex: none;
}
.j-assets {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  min-width: 0;
  gap: 13px;
}
.j-asset {
  min-width: 0;
  margin: 0;
  padding: 0;
}
.j-asset img,
.j-asset video {
  display: block;
  width: 100%;
  max-height: 58vh;
  object-fit: contain;
  border-radius: 9px;
  background: var(--rail);
}
.j-asset audio {
  width: 100%;
}
.j-asset figcaption,
.j-file-line {
  display: flex;
  gap: 9px;
  align-items: center;
  min-height: 44px;
  color: var(--muted);
  font-size: 0.83rem;
}
.j-asset figcaption > span,
.j-file-line > span {
  flex: 1;
  min-width: 0;
}
.j-asset figcaption > a {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
}
.j-detail-actions {
  border-top: 1px solid var(--line);
  padding-top: 13px;
}
.j-editor [hidden] {
  display: none !important;
}
.j-editor-details {
  border-block: 1px solid var(--line);
}
.j-editor-details + .j-editor-details {
  border-top: 0;
}
.j-editor-details summary {
  justify-content: space-between;
  font-weight: 600;
  font-size: 0.91rem;
}
.j-editor-details[open] summary svg {
  transform: rotate(180deg);
}
.j-editor-details > .form-stack {
  padding: 8px 0 16px;
}
.j-file-line small {
  display: block;
}
.j-file-reminder {
  padding: 8px 0;
}
.j-file-reminder p,
.j-bin p {
  color: var(--muted);
}
.j-error:empty,
.j-draft:empty {
  display: none;
}
.j-error {
  color: var(--rust);
}
.j-editor .j-upload input {
  white-space: normal;
  max-width: 100%;
  font-size: 0.9rem;
}
.j-editor .j-upload input::file-selector-button {
  margin-right: 8px;
  font: inherit;
  color: var(--accent);
  border: 0;
  border-radius: 5px;
  background: var(--soft);
  padding: 8px;
}
.j-inline > input {
  flex: 1;
  min-width: 100px;
}
.j-bin .entry-row {
  width: 100%;
}
@media (hover: hover) {
  .j-day:hover:not([aria-pressed="true"]),
  .j-chip:hover:not([aria-pressed="true"]) {
    background: var(--soft);
  }
  .j-memory-card:hover,
  .j-envelope:hover {
    border-color: var(--accent);
  }
}
@media (max-width: 980px) {
  .j-calendar-layout {
    grid-template-columns: minmax(270px, 1.15fr) minmax(170px, 0.8fr);
    gap: 17px;
  }
}
@media (max-width: 820px) {
  .j-calendar-layout {
    grid-template-columns: minmax(0, 1fr);
  }
}
@media (max-width: 550px) {
  .j-editor-actions > .primary {
    width: 100%;
  }
  .j-calendar-panel {
    padding: 13px 10px 10px;
  }
  .j-agenda-heading {
    padding-bottom: 12px;
  }
  .j-day {
    min-height: 44px;
  }
  .j-envelope {
    grid-template-columns: 36px minmax(0, 1fr);
    gap: 10px;
  }
  .j-envelope-icon {
    width: 36px;
    height: 36px;
  }
  .j-envelope-date {
    grid-column: 2;
  }
  .j-memory-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 9px;
  }
  .j-memory-copy {
    padding: 10px;
  }
  .j-memory-copy strong {
    font-size: 1.16rem;
  }
  .j-memory-grid > :is(.j-memory-card, .j-memory-tile):only-child {
    grid-column: 1/-1;
  }
  .j-memory-grid > .j-memory-tile:only-child .j-photo-surface img {
    max-height: 36dvh;
  }
}
@media (max-width: 355px) {
  .j-plan-views {
    gap: 0;
  }
  .j-plan-views .j-chip {
    padding-inline: 8px;
  }
  .j-calendar-panel {
    padding-inline: 5px;
  }
  .j-memory-grid {
    grid-template-columns: minmax(0, 1fr);
  }
}
