/* The phone's landscape reading: white page, date columns across the top,
   horizontal snakes centred beneath. Same faces and greys as the app. */

* { box-sizing: border-box; margin: 0; }

/* `hidden` must always win — the sections set their own display values. */
[hidden] { display: none !important; }

html, body { height: 100%; }

body {
  font: 16px/1.5 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  color: rgba(0, 0, 0, 0.9);
  background: #fff;
  overflow: hidden;
}

/* Sign in/out float over the timeline, out of the way. */
header {
  position: fixed;
  top: 16px;
  right: 16px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
}

h1 { display: none; }   /* the calendar IS the page */

/* Centred message states (signed out / loading / empty / error). */
#signed-out, #loading, #empty, #error {
  height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  text-align: center;
  padding: 0 24px;
}

#signed-out h1 { display: block; }

.fine {
  color: rgba(0, 0, 0, 0.55);
  font-size: 13px;
  margin-top: 8px;
  max-width: 460px;
}

#error-text { color: #b00020; }

/* ------------------------------------------------------ accepting an invite */

#invite-header {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  border-radius: 999px;
  padding: 8px 14px;
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  cursor: pointer;
}

#invite-header:hover { background: #F6F7F9; }

#invite-row {
  display: flex;
  gap: 8px;
  margin-top: 28px;
  width: min(420px, 100%);
}

#invite-row input {
  flex: 1;
  min-width: 0;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 999px;
  padding: 10px 16px;
  font: 500 14px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

#invite-row button {
  border: 1px solid #2A2E34;
  background: #2A2E34;
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  font: 600 14px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  cursor: pointer;
}

/* ------------------------------------------------------------ the timeline */

#zoo { height: 100vh; }

.timeline {
  height: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  position: relative;
  /* Painting drags across cells — never let the drag select date text. */
  user-select: none;
  -webkit-user-select: none;
}

.track {
  display: flex;
  align-items: stretch;
  height: 100%;
  width: max-content;
  position: relative;   /* the skin strips position against the track */
}

/* One day: the grid line at its start (BEHIND the snakes), date lines on top,
   the snakes centred in the remaining height. Width set inline; it animates
   when a backward drag pulls the day open. */
.day-col {
  flex: none;
  position: relative;
  display: flex;
  flex-direction: column;
  height: 100%;
  transition: width 0.22s ease-out;
}

/* The grey day grid — one vertical line where each day begins, Today included,
   drawn behind everything in the column. */
.grid-line {
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 1px;
  background: rgba(0, 0, 0, 0.07);
}

.date-head {
  flex: none;
  margin-top: 7vh;
  height: 84px;
  padding-left: 16px;
}

.date-title {
  font-size: 28px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.9);
  white-space: nowrap;
}

.date-sub {
  font-size: 20px;
  font-weight: 500;
  color: rgba(0, 0, 0, 0.55);
  white-space: nowrap;
}

/* The snakes travel as ONE block, centred in the space below the dates —
   the space above the first snake always equals the space below the last. */
.cells {
  display: flex;
  flex-direction: column;
  gap: 96px;
  margin: auto 0;
}

/* One animal's slice of one day — segments position absolutely inside.
   Height mirrors SNAKE_H in app.js; change them together. */
.cell {
  position: relative;
  height: 128px;
  flex: none;
}

.seg {
  position: absolute;
  top: 0;
  height: 100%;
}

/* The ZooAnimal wrap: the skin strip riding the connected run from Today —
   above the colours, below the chips and names. */
.texture {
  position: absolute;
  background-repeat: repeat-x;
  background-size: auto 100%;
  background-position: left center;
  opacity: 0.3;
  pointer-events: none;
}

/* A comfortable click target wrapped around each pending junction. */
.junction-hit {
  position: absolute;
  top: 0;
  width: 32px;
  height: 100%;
  z-index: 3;
}

.junction-hit.editable { cursor: pointer; }

/* The pulsing unagreed seam — the 8px gap between facing pill ends. */
.seam {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 8px;
  height: 80%;
  border-radius: 3px;
  background: #000;
  animation: pulse 1.8s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { opacity: 0.06; }
  50% { opacity: 0.20; }
}

/* An agreed time as a proper chip STRADDLING its seam — the app's handover
   chip language, sized to read as the button it is. */
.time-chip {
  position: absolute;
  top: 50%;
  transform: translate(-50%, -50%);
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.16);
  border-radius: 999px;
  padding: 10px 18px;
  font-size: 16px;
  font-weight: 600;
  line-height: 1;
  color: rgba(0, 0, 0, 0.85);
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.10);
  white-space: nowrap;
  z-index: 3;
}

.time-chip.editable { cursor: pointer; }

/* Animal names float in the air just above each snake's start, pinned while
   the timeline scrolls beneath (tops set from layout in app.js). */
.names {
  position: fixed;
  top: 0;
  left: 16px;
  z-index: 5;
  pointer-events: none;
}

.name {
  position: fixed;
  left: 16px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
  color: rgba(0, 0, 0, 0.55);
}

/* --------------------------------------------------- the keeper-pill pick
   Release shows the pick rising from the page bottom: a white fade upward,
   an "N days" caption, and the animal's CUT PILLS — each keeper's colour
   wearing the skin texture, Clear a quarter shorter. */

#pick-backdrop {
  position: fixed;
  inset: 0;
  z-index: 20;
}

#pick-sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 21;
  padding: 96px 0 0;
  background: linear-gradient(to top, #fff 58%, rgba(255, 255, 255, 0));
}

.pick-caption {
  font-size: 14px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  text-align: center;
  margin-bottom: 14px;
}

/* The pills stand on the physical bottom edge, bottoms aligned. */
.pick-pills {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 10px;
  padding: 0 16px;
  overflow-x: auto;
}

/* A keeper as a cut pill: rounded shoulders, flat bottom, texture climbing
   from the base, the name in white in the bottom zone. */
.pick-pill {
  position: relative;
  width: 64px;
  flex: none;
  border: none;
  border-radius: 32px 32px 0 0;
  overflow: hidden;
  cursor: pointer;
  padding: 0;
}

.pick-tex {
  position: absolute;
  inset: 0;
  background-size: 100% auto;
  background-position: bottom;
  background-repeat: repeat-y;
  opacity: 0.35;
  pointer-events: none;
}

.pick-name {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  padding: 0 4px;
  text-shadow: 0 0 1px rgba(0, 0, 0, 0.25);
}

/* Clear wears the unassigned grey with a border, label in the text grey. */
.pick-pill.clear {
  background: #F6F7F9;
  border: 1.5px solid rgba(0, 0, 0, 0.15);
  border-bottom: none;
}

.pick-pill.clear .pick-name {
  color: rgba(0, 0, 0, 0.55);
  text-shadow: none;
}

/* ------------------------------------------------------ the time-agree popup */

#time-pop {
  position: fixed;
  z-index: 22;
  background: #fff;
  border-radius: 14px;
  box-shadow: 0 6px 28px rgba(0, 0, 0, 0.18);
  padding: 12px;
  width: 280px;
}

.tp-title {
  font-size: 13px;
  font-weight: 600;
  color: rgba(0, 0, 0, 0.55);
  margin-bottom: 8px;
}

.tp-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.tp-chip {
  border: 1px solid rgba(0, 0, 0, 0.14);
  background: #fff;
  border-radius: 999px;
  padding: 6px 12px;
  font: 500 13px/1 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
  cursor: pointer;
}

.tp-chip:hover { background: #F6F7F9; }

.tp-exact {
  display: flex;
  gap: 8px;
  align-items: center;
}

.tp-exact input {
  flex: 1;
  border: 1px solid rgba(0, 0, 0, 0.14);
  border-radius: 8px;
  padding: 5px 8px;
  font: 500 14px/1.2 -apple-system, BlinkMacSystemFont, "SF Pro Text", sans-serif;
}

.tp-chip.set {
  background: #2A2E34;
  color: #fff;
  border-color: #2A2E34;
}

/* --------------------------------------------------------------------- toast */

#toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 30;
  background: #2A2E34;
  color: #fff;
  font-size: 14px;
  font-weight: 500;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.2);
}
