/* The days you share: one calm column, whether it sits in a card on /my or
   inside its own popup opened from the playground in the 3D world. */

.days-modal { max-width: 480px; text-align: center; }
/* the kinds list is the tallest thing here; keeping it modest stops the
   popup from becoming a page of its own on a phone */
.days-modal .day-list { max-height: 190px; overflow-y: auto; }
.days-t { color: var(--champagne); font-size: 1.7rem; }
.days-sub {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  font-size: .95rem; line-height: 1.65; margin-top: 6px;
}

/* three plain steps: what kind of day, when, and who it is about */
.day-add { margin-top: 16px; text-align: left; }
.day-add input {
  /* box-sizing and a hard max stop the native date control spilling out of
     the popup, which it did at every width */
  font-size: 16px; margin: 0; width: 100%; max-width: 100%;
  box-sizing: border-box; display: block;
}
.day-add input[type="date"] { min-width: 0; appearance: none; -webkit-appearance: none; }
.day-step {
  font-family: var(--sans); font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold); margin: 26px 0 12px;
}
.day-step:first-child { margin-top: 18px; }
.day-add .btn { display: block; width: 100%; margin-top: 14px; }

/* the kinds of day, as a grid anyone can simply point at */
/* the grid scrolls, and has to look like it does: a soft fade at the foot
   and a scrollbar that is always drawn, never only on hover */
.kind-wrap { position: relative; }
.kind-wrap::after {
  content: ''; position: absolute; left: 0; right: 8px; bottom: 0; height: 42px;
  pointer-events: none; border-radius: 0 0 11px 11px;
  background: linear-gradient(to bottom, rgba(11,15,32,0), rgba(11,15,32,.96));
}
.kind-wrap.at-end::after { opacity: 0; transition: opacity .2s; }
.kind-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 6px; max-height: 176px; overflow-y: scroll; overflow-x: hidden;
  padding-right: 8px;
}
.kind {
  display: flex; align-items: center; gap: 6px; text-align: left;
  padding: 9px 10px; border-radius: 11px; cursor: pointer;
  border: 1px solid rgba(176,132,71,.22); background: rgba(8,12,26,.5);
  color: var(--ivory); font-family: var(--serif); font-size: .82rem;
  line-height: 1.15; transition: border-color .2s, background .2s, color .2s;
  /* A tile that wraps onto two lines stands taller than the rest and breaks
     the grid's rhythm. The label stays on one line and is trimmed if it must
     be; the title attribute carries the full words. */
  white-space: nowrap; overflow: hidden;
}
.kind > span { flex: none; }
.kind span { font-size: 1rem; flex: none; }
.kind:hover { border-color: rgba(214,178,133,.6); background: rgba(176,132,71,.12); }
.kind.sel {
  border-color: var(--gold); background: rgba(176,132,71,.2);
  color: var(--champagne); box-shadow: 0 0 12px rgba(214,178,133,.3);
}
.kind-grid::-webkit-scrollbar { width: 6px; height: 6px; }
.kind-grid::-webkit-scrollbar-track { background: rgba(176,132,71,.12); border-radius: 6px; }
.kind-grid::-webkit-scrollbar-thumb { background: rgba(176,132,71,.5); border-radius: 6px; }

.day-list { list-style: none; margin: 14px 0 0; padding: 0; }
.day-row {
  padding: 0; margin-top: 7px; border-radius: 12px; overflow: hidden;
  background: rgba(8,12,26,.5); border: 1px solid rgba(176,132,71,.18);
  text-align: left;
}
/* the row shows the day; the chevron holds when it falls and what can be
   done about it, so a list of ten days reads as ten days */
.day-line { display: flex; align-items: center; gap: 12px; padding: 10px 12px; }
.day-toggle {
  flex: none; width: 30px; height: 30px; border-radius: 50%; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  background: none; border: 1px solid rgba(176,132,71,.22); color: var(--muted);
  transition: border-color .2s, color .2s, background .2s;
}
.day-toggle:hover { border-color: var(--gold); color: var(--champagne); }
.day-chev { display: block; font-size: .8rem; line-height: 1; transition: transform .3s ease; }
.day-row.open .day-chev { transform: rotate(180deg); }
.day-row.open .day-toggle { border-color: var(--gold); color: var(--champagne); }
.day-drop { display: grid; grid-template-rows: 0fr; transition: grid-template-rows .3s ease; }
.day-row.open .day-drop { grid-template-rows: 1fr; }
.day-drop-in { overflow: hidden; min-height: 0; }
/* The dropdown is where a day is actually changed, so it is given room:
   one field per line, generous padding, nothing crowded against anything. */
.day-row.open .day-drop-in {
  position: relative; padding: 17px 16px 18px; margin-top: 2px;
}
/* a soft rule rather than a hard edge across the card */
.day-row.open .day-drop-in::before {
  content: ''; position: absolute; top: 0; left: 12px; right: 12px; height: 1px;
  background: linear-gradient(to right,
    transparent, rgba(176,132,71,.32) 16%, rgba(176,132,71,.32) 84%, transparent);
}
.day-f { display: block; margin-bottom: 14px; }
.day-f > span {
  display: block; margin-bottom: 6px;
  font-family: var(--sans); font-size: .54rem; letter-spacing: .18em;
  text-transform: uppercase; color: var(--gold);
}
.day-f input {
  display: block; width: 100%; max-width: 100%; box-sizing: border-box;
  margin: 0; padding: 11px 13px; border-radius: 10px;
  border: 1px solid rgba(176,132,71,.26); background: rgba(4,6,15,.5);
  color: var(--ivory); font-family: var(--serif); font-size: 16px;
  outline: none; transition: border-color .2s, box-shadow .2s;
}
.day-f input:focus { border-color: var(--gold); box-shadow: 0 0 14px rgba(176,132,71,.2); }
.day-f input[type="date"] { min-width: 0; appearance: none; -webkit-appearance: none; }
.day-drop-acts { display: flex; gap: 10px; margin-top: 4px; }
.day-save {
  flex: 1; cursor: pointer; padding: 10px 14px; border-radius: 999px;
  border: 1px solid var(--gold); background: rgba(176,132,71,.16);
  color: var(--champagne);
  font-family: var(--sans); font-size: .58rem; letter-spacing: .18em;
  text-transform: uppercase;
  transition: background .2s;
}
.day-save:hover { background: rgba(176,132,71,.3); }
.day-save:disabled { opacity: .5; cursor: default; }
.day-drop-acts .day-x { flex: 1; padding: 10px 14px; }
/* the date as a little torn-off calendar leaf: the day answers "when" before
   the words have to */
.day-leaf {
  flex: none; width: 42px; padding: 5px 0 6px; border-radius: 9px; text-align: center;
  background: rgba(176,132,71,.14); border: 1px solid rgba(176,132,71,.28);
}
.day-leaf em {
  display: block; font-style: normal; font-family: var(--sans);
  font-size: .5rem; letter-spacing: .14em; text-transform: uppercase;
  color: var(--gold);
}
.day-leaf b {
  display: block; font-family: var(--serif); font-weight: 400;
  font-size: 1.16rem; line-height: 1.1; color: var(--champagne);
}
.day-lines { flex: 1; min-width: 0; }
.day-name {
  display: block; font-family: var(--serif); color: var(--ivory);
  font-size: 1rem; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-when {
  display: block; margin-top: 2px;
  font-family: var(--sans); font-size: .56rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--muted);
}
.day-acts { flex: none; display: flex; gap: 6px; }
.day-x {
  flex: none; cursor: pointer; padding: 5px 12px; border-radius: 999px;
  background: none; border: 1px solid rgba(176,132,71,.22); color: var(--muted);
  font-family: var(--sans); font-size: .56rem; letter-spacing: .14em;
  text-transform: uppercase;
  transition: color .2s, background .2s, border-color .2s;
}
.day-x:hover { color: var(--champagne); background: rgba(176,132,71,.16); border-color: var(--gold); }
.days-empty {
  font-family: var(--serif); font-style: italic; color: var(--muted);
  padding: 14px 0; text-align: center;
}
.days-ok { font-family: var(--serif); font-style: italic; color: #9fd8a8; }
.days-center { display: block; margin: 12px auto 0; }

/* the calendar plumbing waits behind one quiet line until it is wanted */
.days-fold { margin-top: 18px; text-align: left; }
.days-fold > summary {
  cursor: pointer; text-align: center; list-style: none;
  font-size: .68rem; letter-spacing: .16em; text-transform: uppercase;
  color: var(--muted); padding: 9px 0; border-top: 1px solid rgba(176,132,71,.14);
  transition: color .2s;
}
.days-fold > summary::-webkit-details-marker { display: none; }
.days-fold > summary:hover { color: var(--champagne); }
.days-foldbody { padding-top: 6px; }
.days-how { list-style: none; margin: 10px 0 0; padding: 0; }
.days-how li {
  position: relative; padding-left: 16px; margin-bottom: 7px;
  font-size: .78rem; line-height: 1.6; color: var(--muted);
}
.days-how li::before { content: '·'; position: absolute; left: 4px; color: var(--gold); }
.days-foldbody input { font-size: 16px; width: 100%; margin-top: 10px; }

/* one step at a time: what was chosen stays in view so nobody loses the thread */
.step-chosen {
  font-family: var(--serif); font-style: italic; color: var(--champagne);
  font-size: .88rem; margin-bottom: 8px;
}
.step-nav { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-top: 14px; }
.step-nav .btn { flex: 0 1 auto; min-width: 108px; margin-top: 0; }
.step-nav > span { flex: 1; }

/* the quiet way through to the whole thing: outlined, never a second gold call */
.days-more {
  display: block; width: 100%; margin-top: 14px;
  background: none; border: 1px solid var(--gold); color: var(--champagne);
}
.days-more:hover { background: rgba(176,132,71,.14); }

/* ---------- days already kept ----------
   Ahead and behind under their own small headings: one flat column made a
   birthday next week look exactly like one from last spring. */
.day-head {
  font-family: var(--sans); font-size: .58rem; letter-spacing: .16em;
  text-transform: uppercase; color: var(--gold);
  margin: 16px 0 2px; padding-left: 2px;
}
.day-list .day-head:first-child { margin-top: 8px; }
/* a day that has been and gone steps back rather than disappearing */
.day-row.gone { opacity: .55; }
.day-row.gone:hover { opacity: 1; }
.day-row.gone .day-leaf { background: rgba(176,132,71,.06); border-color: rgba(176,132,71,.16); }
.day-row.gone .day-leaf b { color: var(--muted); }
.day-row.gone .day-leaf em { color: rgba(176,132,71,.6); }

/* ---------- saying the day was kept ----------
   The form quietly resetting itself read as nothing having happened. */
.day-saved {
  display: flex; align-items: center; gap: 9px;
  margin-top: 12px; padding: 11px 14px; border-radius: 12px;
  background: rgba(159,216,168,.1); border: 1px solid rgba(159,216,168,.34);
  font-family: var(--serif); color: #cfe9d3; font-size: .92rem; text-align: left;
  animation: daySavedIn .45s cubic-bezier(.2,.9,.3,1.2) both;
}
.day-saved span:last-child {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.day-saved-tick {
  flex: none; width: 21px; height: 21px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: rgba(159,216,168,.9); color: #0b1a10; font-size: .72rem;
  animation: dayTick .5s .12s cubic-bezier(.2,.9,.3,1.4) both;
}
.day-saved.going { animation: daySavedOut .55s ease both; }
@keyframes daySavedIn {
  from { opacity: 0; transform: translateY(-8px) scale(.97); }
  to   { opacity: 1; transform: none; }
}
@keyframes daySavedOut { to { opacity: 0; transform: translateY(-6px); } }
@keyframes dayTick { from { transform: scale(0) rotate(-40deg); } to { transform: none; } }

/* and the row it made, lit just long enough to be found */
.day-row.just-kept {
  animation: dayRowIn .6s cubic-bezier(.2,.9,.3,1.2) both,
             dayRowGlow 2.4s .3s ease both;
}
@keyframes dayRowIn {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
@keyframes dayRowGlow {
  0%, 45% { border-color: var(--gold); box-shadow: 0 0 20px rgba(214,178,133,.35); }
  100%    { border-color: rgba(176,132,71,.18); box-shadow: none; }
}
@media (prefers-reduced-motion: reduce) {
  .day-saved, .day-saved-tick, .day-row.just-kept { animation: none; }
}

/* an ordinary-looking field: it already reads dd/mm/yyyy when empty, and a
   tap anywhere on it opens the calendar */
.day-add input[type="date"], .day-f input[type="date"] { cursor: pointer; }
.day-add input[type="date"]::-webkit-calendar-picker-indicator,
.day-f input[type="date"]::-webkit-calendar-picker-indicator {
  cursor: pointer; opacity: .55; filter: invert(1);
}

/* An empty date field showed nothing at all in some browsers, so there was
   no telling what it wanted. The shape is written over it until a day is
   chosen, and the real control is untouched underneath. */
.day-datewrap { position: relative; }
.day-datewrap.empty::after {
  content: 'mm/dd/yyyy';
  position: absolute; left: 14px; top: 50%; transform: translateY(-50%);
  pointer-events: none; color: rgba(207,212,234,.45);
  font-family: var(--serif); font-size: 16px;
}
.day-datewrap.empty input[type="date"] { color: transparent; }
.day-datewrap.empty input[type="date"]:focus { color: inherit; }
.day-datewrap.empty input[type="date"]:focus + .day-ph, 
.day-datewrap.empty:focus-within::after { opacity: 0; }

/* a desktop has room for wider tiles, so the longest labels fit whole */
@media (min-width: 641px) {
  .kind-grid { grid-template-columns: repeat(auto-fill, minmax(132px, 1fr)); }
  .kind { font-size: .84rem; padding: 10px 12px; }
}
