/* Outfits + Outfit calendar screens. Scoped to [data-screen="outfits"], [data-screen="calendar"]
   and the .of- / .cal- prefixes (sheets render outside the screen, so they use the prefix only). */

/* ---------- Outfit ideas ---------- */
[data-screen="outfits"] .of-occasions { margin-bottom: 14px; scroll-padding-inline: var(--gutter); }

.of-pin-slot { display: flex; flex-wrap: wrap; column-gap: 8px; }
.of-pin-slot:empty { display: none; }
.of-pin {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  min-height: 40px;
  margin: 0 0 12px;
  padding: 0 6px 0 14px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--rose-50);
  color: var(--ink-2);
  font-size: 13.5px;
}
.of-pin strong { color: var(--plum); font-weight: 600; }
.of-pin-label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.of-pin-x {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  flex: none;
  border-radius: 50%;
  background: rgba(252, 249, 244, 0.8);
  color: var(--rose-ink);
}
.of-pin-x svg { width: 14px; height: 14px; }
.of-pin.of-plan { gap: 6px; padding-left: 10px; }
.of-plan-icon { display: grid; place-items: center; flex: none; color: var(--rose-ink); }
.of-plan-icon svg { width: 16px; height: 16px; }

.of-note {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin: 0 0 12px;
  padding: 10px 14px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink-2);
  font-size: 13px;
  line-height: 1.4;
}
.of-note svg { width: 16px; height: 16px; flex: none; margin-top: 1px; color: var(--muted); }

/* The outfit card */
.of-card {
  position: relative;
  overflow: hidden;
  padding: 14px 14px 10px;
}
.of-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  min-height: 26px;
}
.of-card-top .check-line { font-size: 12.5px; }
.of-weather {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--ink-2);
  font-size: 12.5px;
  white-space: nowrap;
}
.of-weather:empty { display: none; }
.of-weather svg { width: 16px; height: 16px; color: var(--olive-700); }
.of-weather .of-temp { color: var(--plum); font-weight: 600; }

.of-stage {
  position: relative;
  aspect-ratio: 1.34 / 1;
  margin: 6px -2px 2px;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.of-stage-inner { position: absolute; inset: 0; will-change: transform; }
.of-collage { position: absolute; inset: 0; }

.of-piece {
  position: absolute;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 16px;
  overflow: hidden;
  background: var(--surface);
  box-shadow: 0 10px 22px rgba(58, 26, 51, 0.13), 0 2px 5px rgba(58, 26, 51, 0.08);
  transform: rotate(var(--r, 0deg));
  animation: of-pop 0.42s var(--ease) both;
  animation-delay: var(--d, 0ms);
  -webkit-touch-callout: none;
}
.of-piece:active { transform: rotate(var(--r, 0deg)) scale(0.97); }
.of-piece img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  -webkit-user-drag: none;
  pointer-events: none;
}
.of-piece-icon { color: var(--ink-2); opacity: 0.55; }
.of-piece-icon svg { width: 34px; height: 34px; }
.of-piece.role-A { border-radius: 50%; }
.of-piece.role-A .of-piece-icon svg { width: 24px; height: 24px; }
@keyframes of-pop {
  from { opacity: 0; transform: rotate(var(--r, 0deg)) translateY(8px) scale(0.94); }
  to { opacity: 1; transform: rotate(var(--r, 0deg)); }
}

/* Loading skeleton */
.of-skeleton .of-sk-line { display: block; width: 46%; height: 12px; border-radius: 6px; background: var(--surface-3); }
.of-sk-tile {
  position: absolute;
  border-radius: 16px;
  background: linear-gradient(100deg, var(--surface-3) 30%, var(--khaki-50) 50%, var(--surface-3) 70%) 0 0 / 300% 100%;
  animation: of-shimmer 1.4s linear infinite;
}
.of-sk-tile.a { left: 4%; top: 8%; width: 42%; height: 58%; }
.of-sk-tile.b { left: 52%; top: 4%; width: 40%; height: 66%; }
.of-sk-tile.c { left: 18%; top: 70%; width: 32%; height: 26%; }
@keyframes of-shimmer { from { background-position: 100% 0; } to { background-position: -50% 0; } }

/* Fallback when a combination has no hand-made layout */
.of-collage.grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  align-content: center;
  gap: 10px;
  padding: 6px;
}
.of-collage.grid .of-piece { position: relative; aspect-ratio: 1; --r: 0deg; }

/* On me */
.of-onme {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  border-radius: var(--r-md);
  background: radial-gradient(60% 55% at 50% 60%, rgba(252, 249, 244, 0.85), rgba(252, 249, 244, 0) 70%);
  animation: fade-in 0.25s ease both;
}
.of-onme::after {
  content: '';
  position: absolute;
  left: 30%; right: 30%; bottom: 3%;
  height: 10px;
  border-radius: 50%;
  background: rgba(58, 26, 51, 0.08);
  filter: blur(3px);
}
.of-onme .of-avatar { position: relative; z-index: 1; width: auto; height: 100%; max-width: 100%; }
.of-onme-cta {
  position: absolute;
  right: 4px;
  top: 4px;
  z-index: 2;
  min-height: 32px;
  color: var(--plum);
  text-decoration: none;
}

.of-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
}
.of-match { display: inline-flex; align-items: center; gap: 7px; min-width: 0; }
.of-swatches { display: inline-flex; padding-left: 4px; }
.of-swatches .swatch {
  width: 15px;
  height: 15px;
  margin-left: -5px;
  box-shadow: 0 0 0 2px var(--surface-2), inset 0 0 0 1px rgba(0, 0, 0, 0.12);
}
.of-match-label { font-size: 12px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.of-toggle.segmented {
  display: inline-grid;
  flex: none;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-pill);
  background: rgba(74, 34, 64, 0.07);
}
.of-toggle.segmented button {
  min-height: 38px;
  padding: 0 10px;
  border-radius: var(--r-pill);
  font-size: 12.5px;
  white-space: nowrap;
}

/* Pager */
.of-pager {
  display: flex;
  align-items: center;
  gap: 2px;
  margin: 8px -6px 8px;
}
.of-arrow { width: 44px; height: 44px; color: var(--plum); }
.of-arrow:disabled { opacity: 0.3; }
.of-count { min-width: 82px; text-align: center; font-size: 14px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.of-count strong { color: var(--plum); font-weight: 600; }
.of-shuffle.btn.sm { min-height: 44px; padding: 0 12px; }
.of-shuffle.spin svg { animation: of-spin 0.5s var(--ease); }
@keyframes of-spin { from { transform: rotate(-180deg) scale(0.8); } }

.of-tip { margin-bottom: 12px; }
.of-tip span { line-height: 1.35; }
.of-save.is-saved { background: var(--olive-700); }

.of-reasons {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
  list-style: none;
}
.of-reasons:empty { display: none; }
.of-reasons li {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 6px 11px;
  border-radius: var(--r-pill);
  background: var(--olive-50);
  color: var(--olive-700);
  font-size: 12.5px;
  font-weight: 500;
}
.of-reasons svg { width: 13px; height: 13px; }
.of-more { margin: 16px 0 0; text-align: center; font-size: 13px; color: var(--ink-2); }
.of-more .link-btn { min-height: 44px; font-size: 13px; }

/* Start / empty states */
.of-start { padding: 22px 18px 12px; text-align: center; }
.of-ghost { position: relative; height: 150px; max-width: 300px; margin: 0 auto 14px; }
.of-ghost-tile {
  position: absolute;
  top: 0;
  display: grid;
  place-items: center;
  width: 31%;
  aspect-ratio: 1 / 1.12;
  overflow: hidden;
  border-radius: 18px;
  background: rgba(252, 249, 244, 0.65);
  box-shadow: inset 0 0 0 1.5px var(--line-strong);
}
.of-ghost-tile.g0 { left: 4%; top: 10px; transform: rotate(-6deg); }
.of-ghost-tile.g1 { left: 34.5%; top: 34px; transform: rotate(2deg); z-index: 1; }
.of-ghost-tile.g2 { left: 65%; top: 6px; transform: rotate(7deg); }
.of-ghost-tile:not(.owned) { border: 1.5px dashed var(--khaki); box-shadow: none; }
.of-ghost-tile.owned { box-shadow: var(--shadow-2); }
.of-ghost-tile img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.of-ghost-icon { color: var(--khaki); margin-bottom: 18px; }
.of-ghost-icon svg { width: 30px; height: 30px; }
.of-ghost-label {
  position: absolute;
  left: 6px; right: 6px; bottom: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 3px 6px;
  border-radius: 8px;
  font-size: 11.5px;
  font-weight: 500;
  color: var(--ink-2);
}
.of-ghost-tile.owned .of-ghost-label { background: rgba(252, 249, 244, 0.92); color: var(--olive-700); }
.of-ghost-check svg { width: 12px; height: 12px; }
.of-start-title { margin: 2px 0 6px; }
.of-start-text { max-width: 310px; margin: 0 auto 14px; color: var(--ink-2); font-size: 14px; }
.of-need {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
  list-style: none;
}
.of-need li {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border-radius: var(--r-pill);
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13px;
  font-weight: 500;
}
.of-need li.done { background: var(--olive-50); color: var(--olive-700); }
.of-need li.todo { padding: 0; background: none; }
.of-need-btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 5px;
  border: 0;
  border-radius: var(--r-pill);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  color: var(--ink);
  font-size: 13px;
  font-weight: 500;
  -webkit-tap-highlight-color: transparent;
  transition: transform 0.15s var(--ease), background-color 0.15s var(--ease);
}
.of-need-btn::before { content: ''; position: absolute; inset: -4px -2px; } /* 44px touch target */
.of-need-btn:active { transform: scale(0.96); background: var(--surface-2); }
.of-need-btn .of-need-dot { background: var(--olive-50); color: var(--olive-700); }
.of-need li.or { padding: 5px 2px; background: none; color: var(--muted); font-weight: 400; }
.of-need-dot {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--surface-2);
  color: var(--ink-2);
}
.of-need li.done .of-need-dot { background: var(--olive); color: var(--on-olive); }
.of-need-dot svg { width: 14px; height: 14px; }
.of-start-link { margin-top: 4px; }
.of-pinned-empty .of-empty-actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 8px; margin-top: 6px; }

/* Save sheet (renders in the overlay root) */
.of-sheet-thumbs { display: flex; justify-content: center; gap: 8px; margin: -4px 0 16px; }
.of-sheet-thumb {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  overflow: hidden;
  border-radius: 14px;
  box-shadow: var(--shadow-1);
}
.of-sheet-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.of-sheet-thumb .of-piece-icon svg { width: 22px; height: 22px; }
.of-save-q { margin: 0 0 10px; color: var(--ink-2); font-size: 14px; }
.of-when { display: grid; gap: 8px; margin-bottom: 12px; }
.of-when-opt {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 58px;
  padding: 10px 14px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--line);
  text-align: left;
  transition: box-shadow 0.15s, background 0.15s;
}
.of-when-opt[aria-checked='true'] { background: var(--olive-50); box-shadow: inset 0 0 0 1.5px var(--olive); }
.of-radio {
  width: 20px;
  height: 20px;
  flex: none;
  border-radius: 50%;
  background: var(--surface);
  box-shadow: inset 0 0 0 1.6px var(--line-strong);
  transition: box-shadow 0.15s;
}
.of-when-opt[aria-checked='true'] .of-radio { box-shadow: inset 0 0 0 6px var(--olive); }
.of-when-text strong { display: block; font-size: 15px; font-weight: 600; color: var(--plum); }
.of-when-text span { display: block; font-size: 12.5px; color: var(--muted); }
.of-date { margin: -2px 0 12px; }
.of-date .input { -webkit-appearance: none; appearance: none; }

/* ---------- Outfit calendar ---------- */
.cal-empty { margin-bottom: 4px; }
.cal-empty .empty { padding: 34px 22px 26px; }
.cal-empty .btn { margin-top: 6px; }

.cal-month { padding: 12px 12px 12px; }
.cal-month-head { display: flex; align-items: center; justify-content: space-between; margin: 0 0 4px 6px; }
.cal-month-title { font-size: 22px; }
.cal-nav { display: flex; gap: 0; margin-right: -4px; }
.cal-nav .icon-btn { width: 44px; height: 44px; color: var(--plum); }
.cal-weekdays, .cal-grid { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); }
.cal-weekdays span {
  padding: 4px 0 6px;
  text-align: center;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  color: var(--muted);
}
.cal-grid { gap: 3px; }
.cal-day {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 0;
  min-height: 60px;
  padding: 5px 0 5px;
  border: 0;
  border-radius: 14px;
  background: transparent;
  color: var(--ink);
  font-size: 13.5px;
  font-variant-numeric: tabular-nums;
  transition: background 0.15s;
}
.cal-day.blank { pointer-events: none; }
.cal-day:active { background: var(--surface-2); }
.cal-num { display: grid; place-items: center; width: 26px; height: 22px; border-radius: 11px; line-height: 1; }
.cal-day.is-today .cal-num { background: var(--olive); color: var(--on-olive); font-weight: 600; }
.cal-day.has-outfit { background: var(--surface-2); }
.cal-mark { position: relative; display: block; }
.cal-dot-photo {
  position: relative;
  display: grid;
  place-items: center;
  width: 24px;
  height: 24px;
  overflow: hidden;
  border-radius: 50%;
  box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--olive);
}
.cal-day.is-future .cal-dot-photo { box-shadow: 0 0 0 2px var(--surface), 0 0 0 3.5px var(--rose); }
.cal-dot { display: block; width: 8px; height: 8px; margin-top: 8px; border-radius: 50%; background: var(--olive); }
.cal-more {
  position: absolute;
  top: -5px;
  right: -12px;
  padding: 1px 4px;
  border-radius: 8px;
  background: var(--plum);
  color: #fff;
  font-size: 9.5px;
  font-weight: 700;
  line-height: 1.3;
}
.cal-legend { display: flex; gap: 16px; justify-content: center; margin: 10px 0 2px; font-size: 12px; color: var(--ink-2); }
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 50%; box-shadow: inset 0 0 0 2px var(--olive); }
.cal-legend i.planned { box-shadow: inset 0 0 0 2px var(--rose); }

.cal-ph-icon { display: grid; place-items: center; width: 100%; height: 100%; color: var(--ink-2); opacity: 0.5; }
.cal-ph-icon svg { width: 55%; height: 55%; }
.cal-dot-photo img, .cal-mini img, .cal-fav-img img, .cal-piece-img img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* Coming up */
.cal-upcoming { margin-top: 22px; }
.cal-upcoming .section-head { margin-bottom: 10px; }
.cal-up-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  min-height: 64px;
  padding: 10px 10px 10px 14px;
  border: 0;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-1);
  text-align: left;
}
.cal-up-date { display: flex; flex-direction: column; width: 72px; flex: none; }
.cal-up-date strong { font-size: 15px; font-weight: 600; color: var(--plum); }
.cal-up-date span { font-size: 12px; color: var(--muted); }
.cal-up-thumbs { display: flex; padding-left: 8px; }
.cal-mini {
  position: relative;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-left: -8px;
  overflow: hidden;
  border-radius: 11px;
  box-shadow: 0 0 0 2px var(--surface);
}
.cal-up-occ { flex: 1; min-width: 0; text-align: right; font-size: 13px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-up-chev { display: grid; color: var(--muted); }
.cal-up-chev svg { width: 18px; height: 18px; }

/* Stats */
.cal-stats-wrap { margin-top: 22px; }
.cal-stats-wrap .section-head { margin-bottom: 10px; }
.cal-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 10px; }
.cal-stat { padding: 14px 12px 13px; border-radius: var(--r-md); background: var(--surface-2); }
.cal-stat:last-child { background: var(--olive-50); }
.cal-stat strong { display: block; font-family: var(--font-serif); font-size: 30px; font-weight: 500; line-height: 1; color: var(--plum); }
.cal-stat span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--ink-2); }

/* Forgotten favourites */
.cal-forgot-head .eyebrow { display: block; margin-bottom: 4px; }
.cal-forgot-sub { margin: 6px 0 12px; color: var(--ink-2); font-size: 14px; }
.cal-forgot-list {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  margin: 0 calc(-1 * var(--gutter));
  padding: 4px var(--gutter) 8px;
  scroll-snap-type: x proximity;
  scroll-padding-inline: var(--gutter);
  scrollbar-width: none;
}
.cal-forgot-list::-webkit-scrollbar { display: none; }
.cal-fav { flex: none; width: 140px; scroll-snap-align: start; }
.cal-fav-photo {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 1 / 1.08;
  padding: 0;
  border: 0;
  border-radius: var(--r-md);
  overflow: hidden;
  background: var(--surface-2);
  box-shadow: var(--shadow-1);
}
.cal-fav-photo:active { transform: scale(0.98); }
.cal-fav-img { position: absolute; inset: 0; display: grid; place-items: center; }
.cal-fav-heart {
  position: absolute;
  top: 8px;
  right: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: rgba(252, 249, 244, 0.92);
  color: var(--rose-ink);
}
.cal-fav-heart svg { width: 14px; height: 14px; fill: currentColor; }
.cal-fav-name { margin-top: 8px; font-size: 13.5px; font-weight: 500; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-fav-sub { margin-top: 1px; font-size: 12px; color: var(--muted); }
.cal-fav-btn.btn.sm { width: 100%; min-height: 44px; margin-top: 8px; padding: 0 10px; }
.cal-note { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.cal-note p { flex: 1; margin: 0; font-size: 14px; color: var(--ink-2); }
.cal-note .btn { flex: none; }
.cal-note-icon { display: grid; place-items: center; width: 40px; height: 40px; flex: none; border-radius: 50%; background: var(--surface); color: var(--olive-700); }
.cal-note-icon svg { width: 20px; height: 20px; }

/* Day sheet (renders in the overlay root) */
.cal-entries > * + * { margin-top: 12px; }
.cal-entry { padding: 14px; border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-1); }
.cal-entry-head { display: flex; align-items: center; gap: 8px; margin-bottom: 12px; }
.cal-entry-occ.chip { min-height: 28px; padding: 0 12px; font-size: 12.5px; }
.cal-entry-status { font-size: 12.5px; color: var(--muted); }
.cal-entry-wx { display: inline-flex; align-items: center; gap: 4px; margin-left: auto; font-size: 12.5px; color: var(--ink-2); }
.cal-entry-wx svg { width: 15px; height: 15px; color: var(--olive-700); }
.cal-entry-pieces { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 10px; }
.cal-piece { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding: 0; border: 0; background: none; text-align: left; }
.cal-piece-img { position: relative; display: grid; place-items: center; width: 100%; aspect-ratio: 1; overflow: hidden; border-radius: 14px; }
.cal-piece > span:last-child { font-size: 11.5px; color: var(--ink-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-entry-gone { margin: 10px 0 0; font-size: 12.5px; color: var(--muted); }
.cal-entry-actions { display: flex; gap: 8px; margin-top: 14px; }
.cal-entry-actions .btn.sm { min-height: 44px; flex: 1; }
.cal-day-empty p { margin: 0 0 14px; color: var(--ink-2); }
