/* Life Timeline — Левая панель: заголовок, кнопки, выбранное событие, карточка события в панели, список событий.
   Вынесено без изменений из app/life-timeline.html (строки 2435–3129 на 31.10.2026).
   Порядок подключения файлов важен: он повторяет исходный порядок правил. */
.left-panel {
  position: fixed;
  z-index: 18;
  top: 11.8vh;
  left: 1.6vw;
  bottom: 8.8vh;
  width: min(318px, 21.7vw);
  min-width: 292px;
  border-radius: 12px;
  padding: 2.2vh .72vw 3.4vh;
  pointer-events: auto;
  display: flex;
  flex-direction: column;
  min-height: 0;
  transform: translateX(0);
  transition: transform .34s cubic-bezier(.22, 1, .36, 1), border-color .22s ease, background .22s ease, box-shadow .22s ease;
}

.panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  margin: 0 0 1.15vh;
  padding: 0 .2vw 0 .55vw;
}

.panel-title {
  margin: 0;
  flex: 1;
  font-size: 20px;
  font-weight: 430;
  letter-spacing: 0;
}

.panel-toggle {
  position: absolute;
  top: 50%;
  right: -14px;
  z-index: 3;
  width: 16px;
  height: 116px;
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  line-height: 0;
  border-radius: 0 8px 8px 0;
  color: rgba(238, 243, 239, .68);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .070), rgba(255, 255, 255, .020)),
    rgba(18, 22, 25, .72);
  border: 1px solid rgba(238, 243, 239, .15);
  border-left-color: rgba(238, 243, 239, .08);
  box-shadow: 8px 10px 28px rgba(0, 0, 0, .22), inset 1px 0 0 rgba(255, 255, 255, .06);
  transform: translateY(-50%);
  transition: background .18s ease, color .18s ease, border-color .18s ease, transform .22s ease;
}

.panel-toggle:hover {
  color: var(--text);
  background:
    linear-gradient(135deg, rgba(156, 200, 194, .16), rgba(255, 255, 255, .030)),
    rgba(18, 22, 25, .82);
  border-color: rgba(156, 200, 194, .28);
}

.panel-toggle svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .22s ease;
}

.add-button,
.close-form,
.form-save,
.form-delete,
.ghost-button,
.sphere-item,
.impact-dot {
  border-radius: 7px;
}

.add-button {
  min-height: 31px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 10px;
  background: rgba(255, 255, 255, .045);
  color: rgba(229, 248, 244, .94);
  border: 1px solid rgba(238, 243, 239, .14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
  font-size: 13px;
}

.add-button span:first-child {
  font-size: 19px;
  line-height: 1;
}

.close-form {
  display: none;
  width: 32px;
  height: 32px;
  background: rgba(255,255,255,.07);
  color: rgba(238, 243, 239, .76);
  font-size: 20px;
  line-height: 1;
}

body[data-panel="form"] .add-button { display: none; }
body[data-panel="form"] .close-form { display: block; }

.panel-memory-row {
  display: flex;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: wrap;
  gap: 4px;
  margin: -.25vh 0 1.1vh .2vw;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.35;
}

.panel-memory-row .saved-count {
  min-width: 0;
  margin: 0;
}

.panel-memory-separator {
  color: rgba(238, 243, 239, .34);
}

.panel-remember-more {
  min-height: 20px;
  flex: 0 0 auto;
  padding: 0;
  border: 0;
  border-radius: 0;
  color: rgba(181, 221, 215, .90);
  background: transparent;
  font: inherit;
  text-decoration: none;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.panel-remember-more:hover,
.panel-remember-more:focus-visible {
  color: rgba(229, 248, 244, .98);
  text-decoration: underline;
  outline: none;
}

body[data-panel="closed"] .left-panel {
  transform: translateX(calc(-100% - 1.6vw + 18px));
  border-color: transparent;
  background: transparent;
  box-shadow: none;
  backdrop-filter: none;
}

body[data-panel="closed"] .panel-header {
  margin: 0;
  padding: 0;
  display: grid;
  place-items: center;
}

body[data-panel="closed"] .panel-toggle {
  right: -18px;
  width: 18px;
  height: 116px;
  border-radius: 0 8px 8px 0;
  border-color: rgba(238, 243, 239, .15);
  background:
    linear-gradient(135deg, rgba(255, 255, 255, .070), rgba(255, 255, 255, .020)),
    rgba(18, 22, 25, .76);
  box-shadow: 8px 10px 28px rgba(0, 0, 0, .24), inset 1px 0 0 rgba(255, 255, 255, .06);
}

body[data-panel="closed"] .panel-toggle svg {
  transform: rotate(180deg);
}

body[data-panel="closed"] .panel-title,
body[data-panel="closed"] .add-button,
body[data-panel="closed"] .close-form,
body[data-panel="closed"] .panel-memory-row,
body[data-panel="closed"] .remember-more-panel-slot,
body[data-panel="closed"] .saved-count,
body[data-panel="closed"] .scope-chip,
body[data-panel="closed"] .selected-event-card,
body[data-panel="closed"] .event-list,
body[data-panel="closed"] .event-form {
  display: none;
}

.saved-count {
  color: var(--muted);
  font-size: 12px;
  margin: -.25vh 0 1.1vh .2vw;
}

.scope-chip {
  display: none;
  align-self: flex-start;
  max-width: 100%;
  margin: 0 0 1.2vh .1vw;
  padding: 6px 9px;
  border: 1px solid rgba(238, 243, 239, .14);
  border-radius: 7px;
  color: rgba(238, 243, 239, .74);
  background: rgba(255, 255, 255, .045);
  font-size: 12px;
  min-width: 0;
  overflow: hidden;
}

.scope-chip.is-visible {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.scope-chip-label {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.scope-chip-count {
  flex: 0 0 auto;
  color: rgba(238, 243, 239, .52);
  white-space: nowrap;
}

.selected-event-card {
  display: none;
  margin: 0 .1vw 1.1vh;
  padding: 10px 10px 11px;
  border: 1px solid rgba(255, 255, 255, .060);
  border-radius: 8px;
  background:
    linear-gradient(135deg, color-mix(in srgb, var(--event-color) 8%, transparent), rgba(255,255,255,.020)),
    rgba(255, 255, 255, .018);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .035);
}

.selected-event-card.is-open { display: block; }

.event-inline-card {
  margin: 0 0 8px;
  padding: 10px 10px 11px;
  border: 1px solid rgba(255, 255, 255, .060);
  border-color: color-mix(in srgb, var(--event-color) 18%, rgba(255,255,255,.105));
  border-radius: 8px;
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--event-color) 12%, transparent), transparent 7px),
    linear-gradient(135deg, color-mix(in srgb, var(--event-color) 4%, transparent), rgba(255,255,255,.018)),
    rgba(255, 255, 255, .020);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .030);
}

.event-card-head {
  display: grid;
  grid-template-columns: 7fr 3fr;
  gap: 10px;
  align-items: stretch;
  margin-bottom: 9px;
}

.event-card-media {
  position: relative;
  height: 78px;
  border: 1px solid rgba(255, 255, 255, .065);
  border-radius: 7px;
  overflow: hidden;
  background:
    radial-gradient(64% 90% at 76% 34%, color-mix(in srgb, var(--event-color) 34%, transparent), transparent 68%),
    linear-gradient(135deg, rgba(255,255,255,.16), rgba(255,255,255,.030) 44%, rgba(0,0,0,.16)),
    color-mix(in srgb, var(--event-color) 12%, rgba(255,255,255,.035));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .10);
}

.event-card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(255,255,255,.055) 1px, transparent 1px),
    linear-gradient(180deg, rgba(255,255,255,.040) 1px, transparent 1px);
  background-size: 22px 22px;
  opacity: .16;
  mask-image: linear-gradient(90deg, transparent, black 18%, black 82%, transparent);
}

.event-card-media.has-image::after {
  opacity: 0;
}

.event-card-media span {
  position: absolute;
  left: 9px;
  bottom: 8px;
  z-index: 1;
  color: rgba(238, 243, 239, .64);
  font-size: 11px;
}

.event-card-actions {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  gap: 6px;
}

.event-card-action {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border: 0;
  border-radius: 50%;
  background: rgba(255, 255, 255, .035);
  color: rgba(238, 243, 239, .72);
  font-size: 15px;
  line-height: 1;
}

.event-card-action:hover {
  background: rgba(255, 255, 255, .080);
  color: var(--text);
}

.event-card-date-row,
.event-card-date,
.event-card-sphere {
  color: var(--muted);
  font-size: 12px;
}

.event-card-date-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 5px;
  margin-bottom: 5px;
}

.event-card-date-row .event-card-date {
  color: rgba(238, 243, 239, .74);
}

.event-card-date-row .event-card-sphere {
  color: rgba(238, 243, 239, .58);
}

.event-card-date-row .event-card-sphere::before {
  content: "·";
  margin-right: 5px;
  color: rgba(238, 243, 239, .34);
}

.event-card-daytime {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border: 1px solid rgba(156, 200, 194, .22);
  border-radius: 50%;
  background: rgba(156, 200, 194, .080);
  color: rgba(229, 248, 244, .86);
  line-height: 1;
}

.event-card-daytime svg,
.date-chip-icon svg {
  width: 13px;
  height: 13px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.event-card-title {
  margin: 5px 0 9px;
  font-size: 16px;
  font-weight: 540;
  line-height: 1.16;
  letter-spacing: 0;
}

.event-card-title-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.event-card-body {
  display: grid;
  gap: 7px;
  margin: 0 0 10px;
}

.event-card-context {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  min-height: 28px;
}

.event-read-row {
  min-width: 0;
  padding: 0;
  border: 0;
  background: transparent;
  display: flex;
  align-items: center;
  gap: 7px;
  color: rgba(238, 243, 239, .74);
  font-size: 12px;
  line-height: 1.25;
}

.event-card-context .event-read-row {
  flex: 1 1 auto;
}

.event-read-label {
  flex: 0 0 auto;
  color: rgba(238, 243, 239, .42);
  font-size: 10px;
  line-height: 1.1;
}

.event-read-value {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.event-read-row.location .event-read-value {
  color: rgba(238, 243, 239, .86);
  font-weight: 520;
}

.event-read-row.period .event-read-value {
  color: rgba(238, 243, 239, .64);
}

.event-score {
  color: rgba(255, 242, 214, .90);
  font-size: 13px;
  font-weight: 520;
  font-variant-numeric: tabular-nums;
}

.event-card-emotion {
  margin: 4px 0 9px;
  color: rgba(255, 242, 214, .78);
  font-size: 12px;
  line-height: 1.25;
}

.event-card-people {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: flex-end;
  gap: 0;
  flex: 0 0 auto;
  min-width: 0;
}

.event-person-chip {
  display: inline-flex;
  align-items: center;
}

.event-person-chip + .event-person-chip {
  margin-left: -8px;
}

.event-person-chip .person-chip {
  flex: 0 0 auto;
  width: 28px;
  height: 28px;
  margin-right: 0;
  font-size: 12px;
}

.event-person-chip.extra {
  width: 28px;
  height: 28px;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .055);
  color: rgba(238, 243, 239, .74);
  font-size: 11px;
}

.event-card-stories {
  display: grid;
  gap: 6px;
  margin: 2px 0 10px;
}

.event-card-description {
  margin: 2px 0 0;
  padding-top: 9px;
  border-top: 1px solid rgba(238, 243, 239, .07);
  color: rgba(238, 243, 239, .72);
  font-size: 12px;
  line-height: 1.42;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.event-card-description.is-expanded {
  display: block;
  -webkit-line-clamp: unset;
  overflow: visible;
  white-space: pre-wrap;
}

.event-note-toggle {
  justify-self: start;
  margin-top: 6px;
  padding: 0;
  background: transparent;
  color: rgba(156, 200, 194, .86);
  font-size: 12px;
  text-align: left;
}

.event-card-clusters {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin: -1px 0 10px;
}

.cluster-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-width: 0;
  max-width: 100%;
  padding: 4px 7px;
  border: 1px solid color-mix(in srgb, var(--cluster-color) 28%, rgba(238,243,239,.12));
  border-radius: 999px;
  background: color-mix(in srgb, var(--cluster-color) 13%, rgba(255,255,255,.035));
  color: rgba(238, 243, 239, .78);
  font-size: 11px;
  line-height: 1.1;
}

.cluster-chip::before {
  content: "";
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--cluster-color);
  opacity: .72;
}

.event-list {
  flex: 1 1 auto;
  min-height: 0;
  overflow: auto;
  padding: 0 .2vw 28px 0;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent 100%);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 30px), transparent 100%);
}

.list-mode-toggle {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px;
  min-height: 30px;
  margin: 7px 0 8px;
  padding: 3px;
  border: 1px solid rgba(238, 243, 239, .10);
  border-radius: 7px;
  background: rgba(255, 255, 255, .030);
}

.list-mode-option {
  min-width: 0;
  min-height: 24px;
  padding: 0 8px;
  border: 0;
  border-radius: 5px;
  background: transparent;
  color: rgba(238, 243, 239, .58);
  font-size: 11px;
  line-height: 1;
  text-align: center;
  white-space: nowrap;
}

.list-mode-option.is-active {
  background: rgba(238, 243, 239, .10);
  color: var(--text);
  box-shadow: 0 0 0 1px rgba(238, 243, 239, .08) inset;
}

.event-list::-webkit-scrollbar,
.event-form::-webkit-scrollbar,
.sphere-list::-webkit-scrollbar,
.person-list::-webkit-scrollbar,
.period-list::-webkit-scrollbar,
.people-suggestions::-webkit-scrollbar,
.period-suggestions::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.event-row {
  width: 100%;
  min-height: 39px;
  display: grid;
  grid-template-columns: 24px 74px 1fr;
  align-items: center;
  gap: 7px;
  margin-bottom: 0;
  padding: 0 8px;
  border: 1px solid transparent;
  border-bottom-color: rgba(238, 243, 239, .055);
  background: transparent;
  color: rgba(238, 243, 239, .76);
  font-size: 13px;
  text-align: left;
  transition: border-color 140ms ease, background 140ms ease, transform 140ms ease;
}

.event-row:hover {
  border-color: color-mix(in srgb, var(--event-color) 20%, rgba(255,255,255,.09));
  background: color-mix(in srgb, var(--event-color) 8%, rgba(255,255,255,.030));
  color: rgba(238, 243, 239, .90);
}

.event-row.is-selected {
  border-color: color-mix(in srgb, var(--event-color) 34%, rgba(255,255,255,.14));
  background: color-mix(in srgb, var(--event-color) 14%, rgba(255,255,255,.040));
  color: var(--text);
}

.event-row.is-muted {
  opacity: .42;
}

.event-row.is-cluster-match {
  border-color: color-mix(in srgb, var(--cluster-color) 20%, rgba(255,255,255,.08));
  background:
    linear-gradient(90deg, color-mix(in srgb, var(--cluster-color) 10%, transparent), transparent 64%),
    rgba(255, 255, 255, .006);
}

.event-dot {
  justify-self: center;
  width: var(--event-marker-size, 7px);
  height: var(--event-marker-size, 7px);
  border-radius: 50%;
  background: var(--event-color);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--event-color) 18%, transparent), 0 0 12px color-mix(in srgb, var(--event-color) 58%, transparent);
}

.event-year {
  color: rgba(238, 243, 239, .52);
  font-size: 12px;
}

