/* Brand palette override so Web Awesome's brand-variant components (badges,
   buttons, callouts, focus rings) match the site's existing Apple-blue accent
   instead of the library's default hue. Web Awesome themes a full 10–95
   scale rather than a single brand color, so this approximates one around
   the site's original --blue (#0071e3). */
:root{
  --wa-color-brand-10:#001f3d;--wa-color-brand-20:#003366;--wa-color-brand-30:#004c99;
  --wa-color-brand-40:#4b4cc8;--wa-color-brand-50:#5b5ce2;--wa-color-brand-60:#7374ea;
  --wa-color-brand-70:#5aa3ed;--wa-color-brand-80:#94c4f2;--wa-color-brand-90:#cde3fa;
  --wa-color-brand-95:#eaf4fd;
  --wa-font-family-body:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif;
  --wa-font-family-heading:-apple-system,BlinkMacSystemFont,"SF Pro Text","Segoe UI",sans-serif;

  --bg:#f5f5f7;--ink:#1d1d1f;--muted:#6e6e73;--hair:#d2d2d7;--blue:#5b5ce2;
  --shadow:0 8px 28px rgba(0,0,0,.055);
}
*{box-sizing:border-box}
html{scroll-behavior:smooth}
body{margin:0;background:var(--bg);color:var(--ink);font-family:var(--wa-font-family-body);-webkit-font-smoothing:antialiased}

/* --- Hero --- */
.hero{background:linear-gradient(180deg,#fff 0%,#fbfbfd 72%,var(--bg) 100%);padding:66px 24px 46px;text-align:center;border-bottom:1px solid rgba(0,0,0,.035)}
.hero .kicker{font-size:12px;font-weight:700;letter-spacing:.12em;text-transform:uppercase;color:var(--muted);margin-bottom:15px}
h1{font-size:clamp(32px,5vw,62px);line-height:1.02;letter-spacing:-.045em;margin:0 auto 16px;max-width:1100px;font-weight:700}
.hero p{max-width:760px;margin:0 auto;color:var(--muted);font-size:17px;line-height:1.55}
.future-note{max-width:820px;margin:24px auto 0;text-align:left;font-size:14px}
.future-note strong{color:var(--ink);font-weight:650}
.stats{display:flex;justify-content:center;gap:9px;flex-wrap:wrap;margin-top:22px}
.stat{background:#fff;border:1px solid rgba(0,0,0,.055);border-radius:999px;padding:8px 12px;color:var(--muted);font-size:12px}
.stat b{color:var(--ink)}
.stat a{color:var(--blue);text-decoration:none}

/* --- Controls bar --- */
.controls-wrap{position:sticky;top:0;z-index:50;padding:12px 18px;background:rgba(245,245,247,.88);backdrop-filter:saturate(180%) blur(18px);-webkit-backdrop-filter:saturate(180%) blur(18px);border-bottom:1px solid rgba(0,0,0,.05)}
.controls{max-width:none;width:100%;margin:0;background:rgba(255,255,255,.92);border:1px solid rgba(0,0,0,.055);border-radius:16px;padding:10px;box-shadow:0 4px 20px rgba(0,0,0,.035);display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.search-input{flex:1 1 260px}
.group{display:flex;gap:6px;flex-wrap:wrap;align-items:center}

/* --- Page shell --- */
.shell{max-width:none;width:100%;margin:0;padding:30px clamp(22px,3vw,56px) 100px}
.result-row{display:flex;align-items:center;justify-content:space-between;color:var(--muted);font-size:12px;margin:0 4px 18px}

/* --- Timeline layout (bespoke - no WA equivalent) --- */
.timeline{position:relative;padding:4px 0}
.timeline:before{content:"";position:absolute;left:50%;top:8px;bottom:0;width:1px;background:linear-gradient(#c7c7cc,#e5e5ea 96%,transparent);transform:translateX(-.5px)}
.year-row{position:relative;height:56px;display:flex;align-items:center;justify-content:center;clear:both}
.year-pill{position:relative;z-index:3;font-size:12px;font-weight:700;color:#6e6e73;background:#e8e8ed;padding:6px 9px;border-radius:8px;box-shadow:0 0 0 7px var(--bg)}

.event{position:relative;display:grid;grid-template-columns:1fr 72px 1fr;min-height:58px;margin:0 0 16px}
.event.side-left .slot{grid-column:1}
.event.side-right .slot{grid-column:3}
.slot{min-width:0}
.dot{position:absolute;left:50%;top:22px;width:9px;height:9px;border-radius:50%;background:#b1b1b6;border:2px solid var(--bg);box-shadow:0 0 0 1px #b1b1b6;transform:translateX(-50%);z-index:4}
.event.milestone{margin:18px 0 28px}
.event.milestone .dot{top:31px;width:13px;height:13px;background:var(--blue);box-shadow:0 0 0 1px var(--blue),0 0 0 6px rgba(0,113,227,.09)}

/* --- Event cards, built on <wa-details> via ::part() --- */
.event-details{display:block}
.event-details::part(details){border-radius:15px;box-shadow:var(--shadow)}
.event-details::part(header){padding:0}
.event-details::part(content){padding:0 15px 15px 152px;color:var(--muted);font-size:12.5px;line-height:1.55}
.event-details::part(content) p{margin:0;border-top:1px solid #eeeef0;padding-top:12px}
.event-details::part(content) p + p{margin-top:12px}
.event-details::part(content) a{color:var(--blue);text-decoration:none}
.card-head{display:flex;gap:16px;align-items:flex-start;padding:13px 15px;width:100%}
.card-side{width:124px;flex:0 0 124px;display:flex;flex-direction:column;gap:10px;align-items:flex-start}
.date{font-size:11px;line-height:1.25;color:var(--muted);font-weight:650;padding-top:2px}
.timeline-feature-thumb{display:block;width:112px;height:84px;object-fit:cover;border-radius:12px;background:#eee}
.timeline-feature-placeholder{display:grid;place-items:center;background:#dfe1e7;color:#737783;border:1px dashed #afb2bd;font-size:10px;font-weight:750;text-transform:uppercase;letter-spacing:.04em}
.event-details.no-feature-image::part(details){box-shadow:0 0 0 1px #c5c7ce,var(--shadow)}
.event-details.no-feature-image .card-side::after{content:'No image';display:grid;place-items:center;width:112px;height:84px;box-sizing:border-box;background:#dfe1e7;color:#737783;border:1px dashed #afb2bd;border-radius:12px;font-size:10px;font-weight:750;letter-spacing:.04em;text-transform:uppercase}
.timeline-feature-thumb.is-video{height:auto;aspect-ratio:16/9}
.head-main{min-width:0;flex:1}
.title{font-size:14px;line-height:1.25;font-weight:700;letter-spacing:-.01em;margin:0}
.meta{display:flex;gap:6px;align-items:center;margin-top:7px;flex-wrap:wrap}
.summary-excerpt{display:-webkit-box;-webkit-box-orient:vertical;-webkit-line-clamp:3;overflow:hidden;margin:10px 0 0;color:var(--muted);font-size:12px;line-height:1.45}
.read-more-hint{display:inline-block;margin-top:6px;color:var(--blue);font-size:11px;font-weight:650}
.event-details[open] .summary-excerpt{
  display:block;
  -webkit-line-clamp:unset;
  overflow:visible;
}
.event-details[open] .read-more-hint{display:none}
.event-details[open] .expanded-summary{display:none}
.timeline-launch{display:inline-flex;align-items:center;justify-content:center;min-height:40px;padding:0 16px;border-radius:12px;background:linear-gradient(180deg,#6d6af6 0%,#5f5ce6 100%);color:#fff !important;font-weight:700;letter-spacing:-.01em;box-shadow:0 10px 22px rgba(95,92,230,.18)}
.timeline-launch:hover{filter:brightness(1.02);text-decoration:none}
.timeline-launch:active{transform:translateY(1px)}

.event-details.feature::part(details){border-radius:20px;background:linear-gradient(180deg,#fff,#fdfdfe)}
.event-details.feature .card-head{padding:19px 20px 16px}
.event-details.feature .card-side{width:154px;flex-basis:154px;gap:12px}
.event-details.feature .date{font-size:12px}
.event-details.feature .timeline-feature-thumb{width:144px;height:108px;border-radius:14px}
.event-details.feature .timeline-feature-placeholder{display:grid}
.event-details.feature.no-feature-image .card-side::after{width:144px;height:108px;border-radius:14px}
.event-details.feature .timeline-feature-thumb.is-video{height:auto}
.event-details.feature .title{font-size:19px;line-height:1.15;letter-spacing:-.022em}
.event-details.feature .meta{margin-top:9px}
.event-details.feature .summary-excerpt{font-size:13px;line-height:1.5;margin-top:12px}
.event-details.feature::part(content){padding:0 20px 18px 184px;font-size:13px}
.event-details.feature::part(content) p{padding-top:13px}

.empty{padding:80px 20px;text-align:center;color:var(--muted)}
.footer{text-align:center;color:#8e8e93;font-size:12px;margin-top:52px}

@media(max-width:760px){
  .hero{padding-top:48px}.controls-wrap{padding:8px}.controls{border-radius:13px}.shell{padding:22px 12px 70px}
  .timeline:before{left:20px}.year-row{justify-content:flex-start;padding-left:0}.year-pill{margin-left:0}
  .event{display:block;padding-left:42px;margin-bottom:12px}.event .slot{width:100%}
  .dot{left:20px;top:20px}.event.milestone .dot{top:28px}
  .event-details::part(content),.event-details.feature::part(content){padding-left:15px}
  .card-head{gap:11px}
  .card-side{width:92px;flex-basis:92px}
  .event-details.feature .card-side{width:108px;flex-basis:108px}
  .timeline-feature-thumb{width:84px;height:64px}
  .event-details.feature .timeline-feature-thumb{width:98px;height:74px}
  .timeline-feature-thumb.is-video,.event-details.feature .timeline-feature-thumb.is-video{height:auto}
  .event.milestone{margin:16px 0 22px}
}

/* --- Login page --- */
.login-body{display:flex;align-items:center;justify-content:center;min-height:100vh;margin:0}
.login-shell{max-width:360px;width:100%;text-align:center}
.login-shell h1{font-size:32px;margin-bottom:4px}
.login-sub{color:var(--muted);font-size:14px;margin:0 0 24px}
.login-form{display:flex;flex-direction:column;gap:14px;text-align:left;margin-top:16px}
.login-form wa-button{margin-top:6px;width:100%}

/* --- Event detail page --- */
.detail-shell{max-width:none;width:100%}
.detail-shell > p > a{color:var(--blue);text-decoration:none;font-size:13px}
.detail-card{margin-top:14px;display:block}
.detail-card h1{font-size:28px;margin:6px 0 14px}
.detail-card .summary{font-size:15px;line-height:1.6;color:var(--ink)}
.detail-card .notes{margin-top:24px;border-top:1px solid #eee;padding-top:18px}
.detail-card .notes h2{font-size:15px;margin:0 0 8px}
.detail-card .notes p{font-size:14px;line-height:1.65;color:#3a3a3d}
.detail-facts{margin-top:20px;font-size:13px}
.detail-facts dt{font-weight:650;color:var(--muted);margin-top:8px}
.detail-facts dd{margin:2px 0 0}
.sources{margin-top:24px;border-top:1px solid #eee;padding-top:18px;font-size:13px}
.sources h2{font-size:15px;margin:0 0 8px}
.sources ul{margin:0;padding-left:18px}
.media-note{margin-top:24px;font-size:12.5px}
.media-feature,.media-gallery,.media-audio,.media-documents,.media-youtube{margin-top:24px;border-top:1px solid #eee;padding-top:18px}
.media-gallery h2,.media-audio h2,.media-documents h2,.media-youtube h2{font-size:15px;margin:0 0 8px}
.media-documents ul{margin:0;padding-left:18px;font-size:13px}

/* Full-width event/media view */
.detail-shell{padding-left:clamp(24px,4vw,72px);padding-right:clamp(24px,4vw,72px)}
.detail-nav{margin:0 0 18px;font-size:13px}
.detail-nav a{color:var(--blue);text-decoration:none}
.detail-card{width:100%}
.detail-card::part(base){width:100%}
.detail-header{max-width:1200px}
.detail-header h1{max-width:none;margin-left:0;margin-right:0}
.event-media-browser{margin-top:28px;border-top:1px solid #eee;padding-top:20px}
.event-media-toolbar{display:flex;align-items:flex-end;justify-content:space-between;gap:20px;flex-wrap:wrap;margin-bottom:16px}
.event-media-toolbar h2{font-size:20px;margin:0}
.event-media-toolbar p{margin:4px 0 0;color:var(--muted);font-size:12px}
.media-group{margin-top:18px}
.media-group[hidden]{display:none!important}
.media-group h3{font-size:15px;margin:0 0 10px}
.media-group-video{order:1}.media-group-photo{order:2}.media-group-audio{order:3}.media-group-document{order:4}
.media-public-meta{display:flex;align-items:center;justify-content:space-between;gap:10px}
.feature-pill{display:inline-flex;align-items:center;width:max-content;border-radius:999px;background:#eef1ff;color:#514fd2;padding:4px 7px;font-size:10px;font-weight:700;font-style:normal}
.media-gallery-item{position:relative}
.media-gallery-item .feature-pill{position:absolute;left:7px;top:7px;background:rgba(255,255,255,.94)}
.media-file-list{list-style:none;padding:0;margin:0;display:grid;grid-template-columns:repeat(auto-fit,minmax(260px,1fr));gap:10px}
.media-file-list li{border:1px solid #e5e5e7;border-radius:12px;background:#fff;padding:12px;display:flex;justify-content:space-between;gap:12px}
.media-file-list a{color:var(--blue);text-decoration:none}
.media-file-list span{font-size:10px;color:var(--muted)}
.event-context{margin-top:30px;border-top:1px solid #eee;padding-top:22px}
.media-empty{margin-top:24px;color:var(--muted)}


/* --- Application shell / semantic design layer --- */
:root{
  --app-surface-page:#f3f4f7;
  --app-surface-primary:#ffffff;
  --app-surface-elevated:#ffffff;
  --app-surface-subtle:#f7f7fa;
  --app-surface-interactive:#f0f0f5;
  --app-text-primary:#1d1d1f;
  --app-text-secondary:#4b4b50;
  --app-text-muted:#77777f;
  --app-border-normal:#d9dae1;
  --app-border-subtle:#e9e9ee;
  --app-brand-primary:#5b5ce2;
  --app-brand-soft:#ececff;
  --app-brand-hover:#4f50cf;
  --app-brand-active:#4445bc;
  --app-interaction-hover:#f1f1f6;
  --app-focus-color:#5b5ce2;
  --app-content-max:1440px;
  --app-rail-width:84px;
}
body.app-has-rail{background:var(--app-surface-page);padding-left:108px;font-family:Inter,-apple-system,BlinkMacSystemFont,"Segoe UI",sans-serif}
.app-rail{position:fixed;left:12px;top:12px;bottom:12px;width:var(--app-rail-width);z-index:100;display:flex;flex-direction:column;align-items:stretch;padding:10px 8px;background:rgba(255,255,255,.94);border:1px solid var(--app-border-subtle);border-radius:12px;box-shadow:0 6px 24px rgba(20,20,30,.045);backdrop-filter:blur(14px)}
.app-rail-mark{width:44px;height:44px;margin:0 auto 10px;display:grid;place-items:center;border-radius:10px;background:var(--app-brand-primary);color:#fff;text-decoration:none;font-size:18px;font-weight:800;letter-spacing:-.04em}
.app-rail-nav,.app-rail-bottom{display:flex;flex-direction:column;gap:4px}.app-rail-bottom{margin-top:auto}
.app-rail-link{min-height:58px;padding:7px 4px;border-radius:9px;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:4px;color:#6a6a72;text-decoration:none;font-size:10.5px;font-weight:650;line-height:1.1;text-align:center}
.app-rail-link:hover{background:var(--app-interaction-hover);color:var(--app-text-primary)}
.app-rail-link.is-active{background:var(--app-brand-soft);color:var(--app-brand-primary)}
.app-rail-version{min-height:58px;width:100%;padding:7px 4px;border:0;border-radius:9px;background:transparent;color:#6a6a72;font:inherit;font-size:10.5px;font-weight:650;line-height:1.1;text-align:center;cursor:pointer}
.app-rail-version::before{content:'☷';display:block;margin-bottom:5px;font-size:18px;line-height:1}
.app-rail-version:hover,.app-rail-version:focus-visible{background:var(--app-interaction-hover);color:var(--app-text-primary);outline:none}
.app-icon{width:19px;height:19px;flex:0 0 auto}
.app-page-actions{max-width:var(--app-content-max);width:calc(100% - 48px);margin:0 auto 16px;display:flex;gap:8px;align-items:center;flex-wrap:wrap}
.app-back-button,.app-action-button{display:inline-flex;align-items:center;gap:7px;min-height:40px;padding:0 14px;border-radius:9px;background:var(--app-brand-primary);color:#fff!important;text-decoration:none!important;font-size:13px;font-weight:700;box-shadow:none;border:1px solid transparent}
.app-back-button:hover,.app-action-button:hover{background:var(--app-brand-hover)}
.app-back-button .app-icon,.app-action-button .app-icon{width:17px;height:17px}
.app-action-button-secondary{background:var(--app-surface-primary);border-color:var(--app-border-normal);color:var(--app-text-primary)!important}
.app-action-button-secondary:hover{background:var(--app-interaction-hover)}

/* Consistent desktop content width. Wide enough for real work, but not edge-to-edge. */
body.app-has-rail .shell,body.app-has-rail .admin-shell{max-width:var(--app-content-max)!important;width:calc(100% - 48px)!important;margin-left:auto!important;margin-right:auto!important;padding-left:0!important;padding-right:0!important}
body.app-has-rail .controls{max-width:var(--app-content-max)!important;width:calc(100% - 48px)!important;margin-left:auto!important;margin-right:auto!important}

/* Compact application header rather than marketing hero. */
body.app-has-rail .hero{padding:34px 0 24px;text-align:left;background:transparent;border-bottom:0}
body.app-has-rail .hero>*{max-width:var(--app-content-max);width:calc(100% - 48px);margin-left:auto;margin-right:auto}
body.app-has-rail .hero .kicker{margin-bottom:8px;font-size:11px}
body.app-has-rail .hero h1{max-width:var(--app-content-max);font-size:42px;line-height:1.04;margin-bottom:8px}
body.app-has-rail .hero p{max-width:900px;margin-left:calc((100% - min(var(--app-content-max), calc(100% - 48px)))/2);margin-right:auto;font-size:15px;line-height:1.5}
body.app-has-rail .future-note{max-width:900px;margin-top:16px;margin-left:calc((100% - min(var(--app-content-max), calc(100% - 48px)))/2)}
body.app-has-rail .stats{justify-content:flex-start;margin-top:14px}

/* Keep working surfaces restrained. */
body.app-has-rail wa-card::part(base),body.app-has-rail .admin-panel,body.app-has-rail .media-event-picker{box-shadow:none;border-color:var(--app-border-normal)}
body.app-has-rail .timeline-launch{background:var(--app-brand-primary);box-shadow:none;border-radius:9px;min-height:40px}
body.app-has-rail .timeline-launch:hover{background:var(--app-brand-hover)}

@media(max-width:900px){
  body.app-has-rail{padding-left:0}
  .app-rail{display:none}
  body.app-has-rail .shell,body.app-has-rail .admin-shell,body.app-has-rail .controls,.app-page-actions,body.app-has-rail .hero>*{width:calc(100% - 24px)!important}
}


/* Live timeline filtering */
.event[data-timeline-event][hidden],
.year-row[data-timeline-year][hidden],
#timelineSearchEmpty[hidden]{
  display:none!important;
}

/* Inline timeline media */
.timeline-media-strip{
  display:flex;
  gap:7px;
  flex-wrap:wrap;
  margin:12px 0 4px;
}
.timeline-media-thumb,
.timeline-youtube{
  width:74px;
  height:58px;
  flex:0 0 74px;
}
.timeline-media-thumb{
  border:0;
  padding:0;
  background:transparent;
  border-radius:8px;
  overflow:hidden;
  cursor:pointer;
}
.timeline-media-thumb img,
.timeline-youtube .youtube-play,
.timeline-youtube .youtube-play img{
  width:100%;
  height:100%;
  object-fit:cover;
  border-radius:8px;
}
.timeline-youtube .youtube-play{aspect-ratio:auto}
.timeline-youtube .youtube-play span{font-size:22px}
.timeline-youtube .youtube-embed{width:210px;height:118px}

/* Grid */
.grid-shell{padding-top:28px}
.grid-title-row{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.grid-title-row h1{font-size:26px;letter-spacing:-.02em;margin:0}
.grid-controls-wrap{position:static;padding:0;background:transparent;border:0;margin-bottom:20px}
.grid-controls-wrap .controls{border-radius:12px}
.history-grid{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(280px,1fr));
  gap:16px;
}
.history-grid-card{
  min-width:0;
  background:#fff;
  border:1px solid #e2e2e7;
  border-radius:14px;
  overflow:hidden;
  box-shadow:var(--shadow);
  display:flex;
  flex-direction:column;
}
.history-grid-card.is-milestone{border-color:#c9c9fb}
.history-grid-image{
  display:block;
  position:relative;
  aspect-ratio:4/3;
  overflow:hidden;
  background:#ececf1;
}
.history-grid-image img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.history-grid-empty{
  width:100%;
  height:100%;
  display:grid;
  place-items:center;
  background:#dfe1e7;
  color:#737783;
  border:1px dashed #afb2bd;
  font-size:11px;
  font-weight:750;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.history-grid-card.no-feature-image{border-color:#c5c7ce}
.history-grid-play{
  position:absolute;
  inset:0;
  display:grid;
  place-items:center;
  color:#fff;
  font-size:44px;
  text-shadow:0 2px 12px #000;
}
.history-grid-body{padding:14px;display:flex;flex-direction:column;gap:9px}
.history-grid-date{font-size:11.5px;color:var(--muted);font-weight:650}
.history-grid-body h2{font-size:16px;line-height:1.3;margin:0}
.history-grid-body h2 a{color:var(--ink);text-decoration:none}
.history-grid-body p{
  margin:0;
  color:var(--muted);
  font-size:12.5px;
  line-height:1.5;
  display:-webkit-box;
  -webkit-line-clamp:3;
  -webkit-box-orient:vertical;
  overflow:hidden;
}
@media(min-width:1500px){.history-grid{grid-template-columns:repeat(4,minmax(0,1fr))}}
@media(max-width:900px){.history-grid{grid-template-columns:repeat(2,minmax(0,1fr))}}
@media(max-width:640px){.history-grid{grid-template-columns:1fr}}


/* Event card actions */
.event-action-row{
  display:flex;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:10px;
}
.event-action-row .timeline-launch{
  min-height:36px!important;
  padding:0 13px!important;
  margin:0!important;
  font-size:12px!important;
}


/* Parent event / sub-event timeline */
.subevent-block{
  margin:16px 0 8px;
  padding:12px;
  border:1px solid #dedee6;
  border-radius:12px;
  background:#f7f7fa;
}
.subevent-heading{
  display:flex;align-items:center;justify-content:space-between;
  margin:0 0 9px;padding:0 2px;font-size:11px;color:var(--muted)
}
.subevent-heading strong{
  display:inline-flex;align-items:center;
  min-height:24px;padding:0 8px;border-radius:999px;
  background:#ececf4;color:#54545d;font-size:10.5px;font-weight:750
}
.subevent-timeline{
  position:relative;display:grid;gap:7px
}
.subevent-timeline:before{
  content:"";position:absolute;left:10px;top:18px;bottom:18px;
  width:1px;background:#d3d3dd
}
.subevent-item{
  position:relative;
  display:grid;
  grid-template-columns:22px 84px minmax(0,1fr);
  gap:8px;
  padding:0;
}
.subevent-dot{
  position:relative;z-index:2;
  width:8px;height:8px;margin-top:15px;margin-left:6px;
  border-radius:50%;background:#5b5ce2;
  box-shadow:0 0 0 4px #f7f7fa
}
.subevent-date{
  padding-top:11px;
  color:#6f6f78;font-size:10.5px;font-weight:750;line-height:1.25
}
.subevent-main{
  min-width:0;padding:9px 11px 10px;
  border:1px solid #e1e1e7;border-radius:9px;background:#fff
}
.subevent-title{
  display:inline-block;color:var(--ink);text-decoration:none;
  font-size:12.5px;font-weight:750;line-height:1.3
}
.subevent-title:hover{color:#5b5ce2}
.subevent-main p{
  margin:4px 0 0!important;padding:0!important;border:0!important;
  color:var(--muted);font-size:11.25px;line-height:1.42;
  display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden
}
.subevent-meta{
  display:flex;gap:5px;flex-wrap:wrap;align-items:center;margin-top:7px
}
.subevent-meta span{
  display:inline-flex;align-items:center;min-height:20px;padding:0 6px;
  border-radius:999px;background:#f1f1f4;color:#707079;
  font-size:9px;font-weight:650
}
.subevent-meta a{
  display:inline-flex;align-items:center;min-height:22px;padding:0 7px;
  border:1px solid #d9d8ef;border-radius:7px;background:#fafaff;
  color:#5051bf;text-decoration:none;font-size:9.5px;font-weight:700
}
.subevent-meta a:hover{background:#f0efff}
.grid-subevents{
  margin-top:10px;border:1px solid #e2e2e7;border-radius:9px;background:#f8f8fb;overflow:hidden
}
.grid-subevents summary{
  cursor:pointer;padding:9px 10px;font-size:11px;font-weight:750;list-style:none
}
.grid-subevents summary::-webkit-details-marker{display:none}
.grid-subevents[open] summary{border-bottom:1px solid #e6e6ea}
.grid-subevent-timeline{padding:8px}
.grid-subevent-timeline .subevent-item{grid-template-columns:22px 68px minmax(0,1fr)}
.detail-subevents{padding:0 20px 20px}
.detail-subevents h2{font-size:16px;margin:0 0 8px}
.detail-subevent-timeline{padding:10px;border:1px solid #e2e2e7;border-radius:11px;background:#f7f7fa}
.event-parent-link{margin:9px 0 0!important;font-size:11.5px!important;color:var(--muted)!important}
.event-parent-link a{color:#5051bf;text-decoration:none;font-weight:700}
@media(max-width:700px){
  .subevent-item{grid-template-columns:22px 66px minmax(0,1fr);gap:6px}
  .subevent-main p{-webkit-line-clamp:3}
}

  .subevent-main p{-webkit-line-clamp:3}
}


/* Rich child timeline */
.event-details.has-children.regular .subevent-block{
  margin-left:-137px;
  width:calc(100% + 137px);
}
.event-details.has-children.feature .subevent-block{
  margin-left:-164px;
  width:calc(100% + 164px);
}
.subevent-main{
  display:grid;
  grid-template-columns:auto minmax(0,1fr);
  gap:10px;
  align-items:start;
}
.subevent-copy{min-width:0}
.subevent-thumb{
  display:block;width:86px;height:64px;border-radius:8px;overflow:hidden;
  background:#ececf1;border:1px solid #e1e1e7
}
.subevent-thumb img{display:block;width:100%;height:100%;object-fit:cover}
.subevent-youtube-list{
  display:grid;grid-template-columns:repeat(auto-fit,minmax(180px,1fr));
  gap:7px;margin-top:8px
}
.subevent-youtube{
  min-width:0;border:1px solid #e3e3e8;border-radius:8px;overflow:hidden;background:#fafafa
}
.subevent-youtube .youtube-play{
  position:relative;display:block;width:100%;padding:0;border:0;background:#111;
  aspect-ratio:16/9;cursor:pointer
}
.subevent-youtube .youtube-play img{display:block;width:100%;height:100%;object-fit:cover}
.subevent-youtube .youtube-play span{
  position:absolute;left:50%;top:50%;transform:translate(-50%,-50%);
  display:grid;place-items:center;width:38px;height:38px;border-radius:50%;
  background:rgba(0,0,0,.68);color:#fff;font-size:16px
}
.subevent-youtube .youtube-embed{width:100%;aspect-ratio:16/9}
.subevent-youtube .youtube-embed iframe{display:block;width:100%;height:100%;border:0}
.subevent-media-label{
  padding:6px 8px;color:#66666f;font-size:10px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.subevent-audio-list{display:grid;gap:6px;margin-top:8px}
.subevent-audio-item{
  display:grid;grid-template-columns:minmax(120px,1fr) minmax(180px,260px);
  gap:8px;align-items:center;padding:6px 8px;border:1px solid #e3e3e8;
  border-radius:8px;background:#fafafa
}
.subevent-audio-title{
  min-width:0;color:#55555e;font-size:10.5px;font-weight:650;
  white-space:nowrap;overflow:hidden;text-overflow:ellipsis
}
.subevent-audio-item audio{width:100%;height:28px}
.grid-subevent-timeline .subevent-thumb{width:72px;height:54px}

@media(max-width:760px){
  .event-details.has-children.regular .subevent-block,
  .event-details.has-children.feature .subevent-block{margin-left:0;width:100%}
  .subevent-main{grid-template-columns:1fr}
  .subevent-thumb{width:100%;height:150px}
  .subevent-audio-item{grid-template-columns:1fr}
}


/* Sub-event audio layout refinement */
.subevent-audio-item{
  grid-template-columns:1fr;
  gap:5px;
  align-items:stretch;
}
.subevent-audio-title{
  white-space:normal;
  overflow:visible;
  text-overflow:clip;
  line-height:1.3;
  font-size:10.5px;
  padding:0 2px;
}
.subevent-audio-item audio{
  width:100%;
  max-width:none;
  height:30px;
}


/* Full-width expanded sub-event timeline */
.timeline .event-details.has-children[open]::part(content){
  overflow:visible;
}

.timeline .event-details.has-children[open] .subevent-block{
  position:relative;
  width:var(--subevent-span-width, 100%) !important;
  margin-left:0 !important;
  transform:translateX(var(--subevent-span-shift, 0px));
  box-sizing:border-box;
}

/* Full descriptions in the expanded sub-timeline */
.timeline .subevent-main p{
  display:block !important;
  -webkit-line-clamp:unset !important;
  -webkit-box-orient:initial !important;
  overflow:visible !important;
  white-space:normal;
}

/* Up to 20 image thumbnails per sub-event */
.subevent-gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(74px,1fr));
  gap:6px;
  margin-top:9px;
}
.subevent-gallery-thumb{
  display:block;
  min-width:0;
  aspect-ratio:4/3;
  padding:0;
  border:1px solid #dfdfe6;
  border-radius:7px;
  overflow:hidden;
  background:#ececf1;
  cursor:pointer;
}
.subevent-gallery-thumb img{
  display:block;
  width:100%;
  height:100%;
  object-fit:cover;
}
.subevent-gallery-thumb:hover{
  border-color:#b9b8ef;
  box-shadow:0 0 0 2px rgba(91,92,226,.08);
}

@media(max-width:760px){
  .timeline .event-details.has-children[open] .subevent-block{
    width:100% !important;
    transform:none !important;
  }
  .subevent-gallery{
    grid-template-columns:repeat(4,minmax(0,1fr));
  }
}


/* Parent card is now visually separate from its child timeline. */
.timeline .event-details.has-children{
  position:relative;
  z-index:2;
}
.timeline .event-details.has-children::part(base){
  overflow:hidden;
}
.timeline .event-details.has-children::part(content){
  overflow:hidden;
}
.timeline .event-details.has-children .parent-action-row{
  margin-top:14px;
  margin-bottom:2px;
}

/* The child timeline is a separate full-width panel below the parent card. */
.timeline .parent-subevent-block{
  position:relative;
  width:var(--subevent-span-width,100%) !important;
  margin:10px 0 0 !important;
  transform:translateX(var(--subevent-span-shift,0px));
  box-sizing:border-box;
  border-radius:14px;
  padding:14px 16px 16px;
}
.timeline .parent-subevent-block[hidden]{
  display:none !important;
}

/* Give the wide child timeline comfortable breathing room at both edges. */
.timeline .parent-subevent-block .subevent-heading{
  margin-left:2px;
  margin-right:2px;
}
.timeline .parent-subevent-block .subevent-timeline{
  padding-left:2px;
  padding-right:2px;
}

/* Override the previous rule that expected the child timeline inside wa-details. */
.timeline .event-details.has-children[open] .subevent-block{
  width:auto !important;
  margin-left:0 !important;
  transform:none !important;
}

@media(max-width:760px){
  .timeline .parent-subevent-block{
    width:100% !important;
    transform:none !important;
    margin-top:10px !important;
    padding:12px;
  }
}


/* Restore parent card actions */
.timeline .event-details.has-children .parent-action-row{
  display:flex !important;
  align-items:center;
  flex-wrap:wrap;
  gap:8px;
  margin-top:14px;
  margin-bottom:4px;
}


/* Larger sub-event thumbnails with consistent layout */
.timeline .subevent-main{
  grid-template-columns:156px minmax(0,1fr);
  gap:10px;
}
.timeline .subevent-thumb-slot{
  width:156px;
  min-width:156px;
}
.timeline .subevent-thumb{
  width:156px;
  height:112px;
  border-radius:8px;
}
.timeline .subevent-thumb-empty{
  visibility:visible;
  display:grid;
  place-items:center;
  box-sizing:border-box;
  background:#dfe1e7;
  border:1px dashed #afb2bd;
  color:#737783;
  font-size:10px;
  font-weight:750;
  letter-spacing:.04em;
  text-transform:uppercase;
}
.timeline .subevent-thumb-empty::after{content:'No image'}

/* Larger photo gallery, tighter spacing */
.timeline .subevent-gallery{
  display:grid;
  grid-template-columns:repeat(auto-fill,minmax(148px,1fr));
  gap:3px;
  margin-top:9px;
}
.timeline .subevent-gallery-thumb{
  border-radius:6px;
  aspect-ratio:4/3;
}
.timeline .subevent-gallery-thumb[hidden]{
  display:none !important;
}
.timeline .subevent-gallery-toggle{
  margin-top:7px;
  min-height:30px;
  padding:0 10px;
  border:1px solid #d9d8ef;
  border-radius:7px;
  background:#fafaff;
  color:#5051bf;
  font-size:10.5px;
  font-weight:750;
  cursor:pointer;
}
.timeline .subevent-gallery-toggle:hover{
  background:#f0efff;
}

/* Audio is never collapsed or limited */
.timeline .subevent-audio-list,
.timeline .subevent-audio-item{
  display:grid;
}

/* Keep child copy aligned even when neither child nor parent has an image. */
.timeline .subevent-copy{
  grid-column:2;
}

@media(max-width:760px){
  .timeline .subevent-main{
    grid-template-columns:1fr;
  }
  .timeline .subevent-thumb-slot{
    width:100%;
    min-width:0;
  }
  .timeline .subevent-thumb{
    width:100%;
    height:180px;
  }
  .timeline .subevent-thumb-empty{
    display:none;
  }
  .timeline .subevent-copy{
    grid-column:1;
  }
  .timeline .subevent-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr));
    gap:3px;
  }
}


/* Four-up sub-event photo gallery */
.timeline .subevent-gallery{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:4px !important;
}
.timeline .subevent-gallery-thumb{
  width:100%;
  aspect-ratio:4/3;
}
@media(max-width:760px){
  .timeline .subevent-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}


/* Square sub-event image treatment */
.timeline .subevent-thumb-slot{
  width:156px;
  min-width:156px;
}
.timeline .subevent-thumb{
  width:156px;
  height:156px;
  aspect-ratio:1/1;
}
.timeline .subevent-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Four square gallery images across */
.timeline .subevent-gallery{
  grid-template-columns:repeat(4,minmax(0,1fr)) !important;
  gap:4px !important;
}
.timeline .subevent-gallery-thumb{
  width:100%;
  aspect-ratio:1/1 !important;
}
.timeline .subevent-gallery-thumb img{
  width:100%;
  height:100%;
  object-fit:cover;
}

/* Media order spacing: audio, images, then video */
.timeline .subevent-audio-list{
  margin-top:9px;
}
.timeline .subevent-audio-list + .subevent-gallery{
  margin-top:10px;
}
.timeline .subevent-gallery-toggle + .subevent-youtube-list,
.timeline .subevent-gallery + .subevent-youtube-list{
  margin-top:10px;
}

@media(max-width:760px){
  .timeline .subevent-thumb-slot{
    width:100%;
    min-width:0;
  }
  .timeline .subevent-thumb{
    width:100%;
    height:auto;
    aspect-ratio:1/1;
  }
  .timeline .subevent-gallery{
    grid-template-columns:repeat(2,minmax(0,1fr)) !important;
  }
}


/* Hard square gallery fix.
   Do not rely on aspect-ratio on <button>; force height from width instead. */
.timeline .subevent-gallery-thumb{
  position:relative !important;
  display:block !important;
  width:100% !important;
  height:0 !important;
  padding:100% 0 0 !important;
  aspect-ratio:auto !important;
  overflow:hidden !important;
}
.timeline .subevent-gallery-thumb img{
  position:absolute !important;
  inset:0 !important;
  display:block !important;
  width:100% !important;
  height:100% !important;
  object-fit:cover !important;
}


/* 1.1 Timeline lightbox navigation */
.timeline .subevent-thumb{
  appearance:none;
  border:0;
  padding:0;
  cursor:zoom-in;
  background:transparent;
  overflow:hidden;
}
.timeline .subevent-gallery-thumb{
  cursor:zoom-in;
}

.history-lightbox{
  width:min(1180px,96vw);
  max-width:none;
  max-height:94vh;
  padding:0;
  border:0;
  border-radius:12px;
  background:transparent;
  overflow:visible;
}
.history-lightbox::backdrop{
  background:rgba(17,18,25,.88);
}
.history-lightbox-frame{
  position:relative;
  display:flex;
  align-items:center;
  justify-content:center;
  min-height:min(820px,88vh);
  padding:48px 70px 36px;
  border-radius:12px;
  background:#111219;
  box-shadow:0 20px 70px rgba(0,0,0,.35);
}
.history-lightbox figure{
  display:flex;
  flex-direction:column;
  align-items:center;
  justify-content:center;
  gap:10px;
  width:100%;
  height:100%;
  margin:0;
}
.history-lightbox figure img{
  display:block;
  max-width:100%;
  max-height:78vh;
  width:auto;
  height:auto;
  object-fit:contain;
  border-radius:6px;
}
.history-lightbox figcaption{
  display:flex;
  justify-content:center;
  align-items:center;
  gap:12px;
  min-height:18px;
  color:#f3f3f6;
  font-size:12px;
  text-align:center;
}
.history-lightbox-counter{
  color:#a9a9b4;
  white-space:nowrap;
}
.history-lightbox-close,
.history-lightbox-nav{
  position:absolute;
  z-index:2;
  display:flex;
  align-items:center;
  justify-content:center;
  border:0;
  color:#fff;
  background:rgba(255,255,255,.10);
  cursor:pointer;
}
.history-lightbox-close{
  top:12px;
  right:12px;
  width:34px;
  height:34px;
  border-radius:999px;
  font-size:23px;
  line-height:1;
}
.history-lightbox-nav{
  top:50%;
  width:42px;
  height:64px;
  margin-top:-32px;
  border-radius:9px;
  font-size:38px;
  line-height:1;
}
.history-lightbox-prev{left:14px}
.history-lightbox-next{right:14px}
.history-lightbox-close:hover,
.history-lightbox-nav:hover{
  background:rgba(255,255,255,.18);
}
.history-lightbox-nav[hidden]{
  display:none !important;
}

@media(max-width:760px){
  .history-lightbox{
    width:100vw;
    max-height:100vh;
  }
  .history-lightbox-frame{
    min-height:100vh;
    padding:48px 42px 30px;
    border-radius:0;
  }
  .history-lightbox figure img{
    max-height:82vh;
  }
  .history-lightbox-nav{
    width:34px;
    height:56px;
  }
  .history-lightbox-prev{left:4px}
  .history-lightbox-next{right:4px}
}


/* Timeline navigation and usability */
.timeline-native-search{width:100%;min-height:42px;padding:0 13px;border:1px solid var(--app-border-subtle,#d8d8de);border-radius:10px;background:#fff;color:var(--ink);font:inherit;font-size:14px;outline:none}
.timeline-native-search:focus{border-color:var(--app-brand-primary,#5b5ce2);box-shadow:0 0 0 3px rgba(91,92,226,.12)}
.timeline-year-nav{position:fixed;z-index:70;left:108px;top:50%;transform:translateY(-50%);display:flex;flex-direction:column;align-items:flex-start;max-height:72vh;overflow:auto;padding:6px 4px;gap:1px;border-radius:10px;background:rgba(245,245,247,.78);backdrop-filter:blur(12px)}
.timeline-year-nav button{appearance:none;border:0;background:transparent;padding:2px 6px;border-radius:6px;color:#888891;font:inherit;font-size:9px;font-weight:700;line-height:1.25;cursor:pointer;transition:.12s ease}
.timeline-year-nav button:hover,.timeline-year-nav button.is-active{background:#fff;color:var(--app-brand-primary,#5b5ce2);font-size:11px}
.timeline-back-top{position:fixed;right:22px;bottom:22px;z-index:90;width:42px;height:42px;border:1px solid var(--app-border-subtle,#d8d8de);border-radius:50%;background:rgba(255,255,255,.94);box-shadow:0 8px 24px rgba(0,0,0,.09);color:var(--ink);font-size:20px;cursor:pointer;opacity:0;transform:translateY(8px);pointer-events:none;transition:.16s ease}
.timeline-back-top.is-visible{opacity:1;transform:none;pointer-events:auto}
@media(max-width:1050px){.timeline-year-nav{left:102px}.timeline-year-nav button{font-size:8px;padding:2px 4px}}
@media(max-width:760px){.timeline-year-nav{display:none}.timeline-back-top{right:14px;bottom:14px}}

/* Keep YouTube previews at a useful 16:9 size rather than shallow strips. */
.timeline-media-strip .timeline-youtube{width:220px;height:auto;flex:0 0 220px}
.timeline-media-strip .timeline-youtube .youtube-play{width:100%;height:auto;aspect-ratio:16/9}
.subevent-youtube-list{grid-template-columns:repeat(auto-fit,minmax(240px,360px));align-items:start}
.subevent-youtube .youtube-play,.subevent-youtube .youtube-embed{aspect-ratio:16/9}
.youtube-grid{grid-template-columns:repeat(auto-fit,minmax(280px,420px));align-items:start}

/* Persistent archive audio transport */
.history-global-player[hidden],.history-player-companion[hidden]{display:none!important}
.history-global-player{position:fixed;left:92px;right:16px;bottom:14px;z-index:1200;display:grid;grid-template-columns:34px minmax(120px,260px) 42px minmax(120px,1fr) 42px auto 30px;gap:9px;align-items:center;padding:10px 12px;border:1px solid var(--app-border-normal,#d8d8df);border-radius:14px;background:rgba(255,255,255,.96);backdrop-filter:blur(16px);box-shadow:0 10px 34px rgba(0,0,0,.12)}
.history-global-player audio{display:none}
.history-player-toggle,.history-player-close,.history-player-companion-button{border:1px solid var(--app-border-normal,#d8d8df);background:#fff;color:inherit;cursor:pointer}
.history-player-toggle{width:34px;height:34px;border-radius:999px;font-size:11px}
.history-player-close{width:30px;height:30px;border-radius:8px;font-size:18px;line-height:1}
.history-player-copy{display:flex;flex-direction:column;min-width:0}.history-player-copy strong{font-size:12px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}.history-player-copy span{font-size:10px;color:var(--muted)}
.history-player-time{font-size:10px;color:var(--muted);font-variant-numeric:tabular-nums;text-align:center}
.history-player-seek{width:100%;margin:0;accent-color:var(--blue,#5b5ce2)}
.history-player-companion-button{border-radius:8px;padding:7px 10px;font-size:11px;font-weight:700;white-space:nowrap}
.history-player-companion{position:fixed;right:18px;bottom:80px;z-index:1199;width:min(430px,calc(100vw - 120px));max-height:58vh;display:flex;flex-direction:column;border:1px solid var(--app-border-normal,#d8d8df);border-radius:14px;background:#fff;box-shadow:0 12px 38px rgba(0,0,0,.16);overflow:hidden}
.history-player-companion header{display:flex;align-items:flex-start;justify-content:space-between;gap:12px;padding:12px 14px;border-bottom:1px solid var(--app-border-normal,#ececef)}
.history-player-companion header>div{display:flex;flex-direction:column;gap:2px;min-width:0}.history-player-companion header strong{font-size:13px}.history-player-companion header span{font-size:11px;color:var(--muted);white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
.history-player-companion header button{border:0;background:transparent;font-size:20px;cursor:pointer;color:var(--muted)}
.history-player-companion-body{padding:14px;overflow:auto;white-space:pre-wrap;font-size:12.5px;line-height:1.6}
body.history-player-active{padding-bottom:82px}

/* Timeline YouTube previews: always real 16:9 cards, never shallow strips. */
.timeline-youtube{width:220px!important;height:auto!important;flex:0 0 220px!important}
.timeline-youtube .youtube-play,.timeline-youtube .youtube-embed{width:100%!important;height:auto!important;aspect-ratio:16/9!important;border-radius:9px}
.timeline-youtube .youtube-play img{width:100%!important;height:100%!important;object-fit:cover!important}

@media(max-width:900px){.history-global-player{left:12px;right:12px;grid-template-columns:34px minmax(90px,1fr) 38px minmax(80px,1.2fr) 38px auto 30px}.history-player-companion{right:12px;width:calc(100vw - 24px)}}
@media(max-width:640px){.history-global-player{grid-template-columns:34px minmax(0,1fr) auto 30px}.history-player-time,.history-player-seek{display:none}.history-player-companion-button{padding:7px 8px}.timeline-youtube{width:min(320px,100%)!important;flex-basis:min(320px,100%)!important}}


/* Event/timeline YouTube previews: legacy-safe 16:9 box.
   Uses padding geometry rather than aspect-ratio so older/overriding rules cannot squash the thumbnail. */
.youtube-card .youtube-play.youtube-play-16x9{
  position:relative!important;display:block!important;width:100%!important;height:0!important;
  padding:56.25% 0 0!important;overflow:hidden!important;background:#111!important;
}
.youtube-card .youtube-play.youtube-play-16x9 img{
  position:absolute!important;inset:0!important;width:100%!important;height:100%!important;
  object-fit:cover!important;display:block!important;
}
.youtube-card .youtube-play.youtube-play-16x9 span{position:absolute!important;left:50%!important;top:50%!important;transform:translate(-50%,-50%)!important}
.subevent-youtube-list .subevent-youtube{width:min(360px,100%);max-width:360px}

.catalogue-lyrics-head{display:flex;align-items:center;justify-content:space-between;gap:12px;margin-bottom:8px}
.catalogue-lyrics-head h3{margin:0}
.catalogue-edit-lyrics{display:inline-flex;align-items:center;border:1px solid var(--app-border-normal,#d8d8df);border-radius:8px;padding:5px 8px;font-size:11px;font-weight:700;text-decoration:none;white-space:nowrap}
.track-lyrics:target{outline:2px solid var(--blue,#5b5ce2);outline-offset:2px}

/* Global player companion editing */
.history-player-companion-head-actions{display:flex;align-items:center;gap:6px}
.history-player-companion-head-actions button[data-companion-edit]{border:1px solid var(--app-border-normal,#d8d8df);background:#fff;border-radius:7px;padding:5px 8px;font-size:11px;font-weight:700;cursor:pointer;color:inherit}
.history-player-companion-editor{margin:14px;min-height:260px;max-height:42vh;resize:vertical;border:1px solid var(--app-border-normal,#d8d8df);border-radius:9px;padding:10px 12px;font:inherit;font-size:12.5px;line-height:1.6;background:#fff;color:inherit}
.history-player-companion-footer{display:flex;align-items:center;justify-content:space-between;gap:10px;padding:10px 14px;border-top:1px solid var(--app-border-normal,#ececef);background:#fafafa}
.history-player-companion-footer button{border:1px solid var(--app-border-normal,#d8d8df);background:#fff;border-radius:7px;padding:6px 9px;font-size:11px;font-weight:700;cursor:pointer;color:inherit}
.history-player-companion-footer [data-companion-edit-actions]{display:flex;gap:6px;margin-left:auto}
.history-player-companion-footer [data-companion-save]{background:var(--accent,#5b5ce2);border-color:var(--accent,#5b5ce2);color:#fff}

/* 2026-08-19 timeline utility controls */
.timeline-back-top{right:24px;bottom:88px;width:auto;min-width:68px;height:40px;padding:0 14px;display:flex;align-items:center;justify-content:center;gap:7px;border-radius:999px;font-size:13px;font-weight:700}
.timeline-back-top span{font-size:17px;line-height:1}
.timeline-delete-button{border:0;background:transparent;color:#9f2e2e;font:inherit;font-size:12px;padding:3px 5px;cursor:pointer;border-radius:5px}
.timeline-delete-button:hover{background:#fff1f1;color:#7f1d1d}
.timeline-delete-button:disabled{opacity:.45;cursor:wait}
.subevent-meta .timeline-delete-button{margin-left:2px}
@media(max-width:760px){.timeline-back-top{right:14px;bottom:78px}}

/* =============================================================
   Mobile responsive pass — 2026-08-19
   Desktop remains unchanged. Mobile uses a bottom navigation,
   compact timeline/header, horizontal year navigation, touch-safe
   media/release controls and single-column admin forms.
   ============================================================= */
.app-mobile-nav{display:none}

@media(max-width:900px){
  html{scroll-padding-top:112px}
  body.app-has-rail{padding-left:0!important;padding-bottom:76px;overflow-x:hidden}
  .app-rail{display:none!important}

  .app-mobile-nav{
    position:fixed;left:0;right:0;bottom:0;z-index:1300;
    display:flex;align-items:stretch;gap:2px;
    padding:6px max(6px,env(safe-area-inset-left)) calc(6px + env(safe-area-inset-bottom)) max(6px,env(safe-area-inset-right));
    overflow-x:auto;overscroll-behavior-x:contain;scrollbar-width:none;
    background:rgba(255,255,255,.97);border-top:1px solid var(--app-border-normal);
    box-shadow:0 -7px 24px rgba(0,0,0,.07);backdrop-filter:blur(16px);-webkit-backdrop-filter:blur(16px)
  }
  .app-mobile-nav::-webkit-scrollbar{display:none}
  .app-mobile-nav-link{
    flex:1 0 62px;min-width:62px;height:52px;padding:5px 5px 4px;border-radius:9px;
    display:flex;flex-direction:column;align-items:center;justify-content:center;gap:3px;
    color:#6d6d76;text-decoration:none;font-size:9.5px;font-weight:700;line-height:1;text-align:center
  }
  .app-mobile-nav-link .app-icon{width:18px;height:18px}
  .app-mobile-nav-link.is-active{background:var(--app-brand-soft);color:var(--app-brand-primary)}

  body.app-has-rail .shell,body.app-has-rail .admin-shell,body.app-has-rail .controls,.app-page-actions,
  body.app-has-rail .hero>*,.users-shell{
    width:calc(100% - 20px)!important;max-width:none!important;margin-left:auto!important;margin-right:auto!important
  }
  .app-page-actions{margin-bottom:10px;gap:6px}
  .app-back-button,.app-action-button{min-height:36px;padding:0 11px;font-size:12px}

  /* Global player remains useful on phone, including seek/progress. */
  .history-global-player{
    left:8px!important;right:8px!important;bottom:68px!important;
    grid-template-columns:34px minmax(0,1fr) auto 30px!important;
    grid-template-areas:"play copy companion close" "current seek seek duration"!important;
    gap:6px 8px!important;padding:8px 9px!important;border-radius:12px!important
  }
  .history-player-toggle{grid-area:play}
  .history-player-copy{grid-area:copy}
  .history-player-current,.history-global-player [data-player-current]{grid-area:current}
  .history-player-seek{grid-area:seek;display:block!important;min-width:0}
  .history-player-duration,.history-global-player [data-player-duration]{grid-area:duration}
  .history-player-companion-button{grid-area:companion;padding:6px 8px!important}
  .history-player-close{grid-area:close}
  .history-player-time{display:block!important;font-size:9px!important}
  body.history-player-active{padding-bottom:150px!important}
  .history-player-companion{
    left:8px!important;right:8px!important;bottom:154px!important;width:auto!important;
    max-height:min(62vh,560px)!important;border-radius:12px!important
  }
  .history-player-companion-editor{min-height:180px!important;max-height:38vh!important;margin:10px!important}
  .history-player-companion-footer{flex-wrap:wrap;padding:8px 10px!important}

  /* Timeline header stays compact and usable. */
  .timeline-simple-header{
    display:grid!important;grid-template-columns:auto auto minmax(120px,1fr)!important;
    align-items:center!important;gap:6px!important;padding:7px 10px!important;min-height:52px!important;
    overflow:visible!important
  }
  body.app-has-rail .timeline-simple-header h1{font-size:18px!important;margin:0!important;white-space:nowrap}
  .timeline-page-actions{width:auto!important;flex-wrap:nowrap!important;gap:5px!important}
  .timeline-page-action{min-height:34px!important;padding:0 8px!important;font-size:9px!important}
  .timeline-search-form{width:auto!important;min-width:0!important;max-width:none!important;flex:1 1 auto!important}
  .timeline-search-form .search-input{height:36px!important;min-height:36px!important;font-size:13px!important;padding:0 10px!important}
  .timeline-search-results{width:calc(100% - 20px)!important;margin-top:10px!important}
  .timeline-search-result{
    grid-template-columns:72px minmax(0,1fr) auto!important;gap:9px!important;padding:11px!important;
    height:auto!important;min-height:86px!important;max-height:none!important;align-content:start!important;
    overflow:hidden!important
  }
  .timeline-search-result-body{height:auto!important;min-height:0!important;max-height:none!important;overflow:visible!important}

  /* Years become a sticky horizontal scrub bar instead of disappearing. */
  .timeline-year-nav{
    display:flex!important;position:sticky!important;left:auto!important;top:52px!important;transform:none!important;
    z-index:84!important;flex-direction:row!important;align-items:center!important;gap:3px!important;
    width:100%!important;max-width:none!important;height:38px!important;max-height:none!important;
    padding:5px 10px!important;border-radius:0!important;overflow-x:auto!important;overflow-y:hidden!important;
    background:rgba(245,245,247,.96)!important;border-bottom:1px solid var(--app-border-subtle)!important;
    scrollbar-width:none!important;backdrop-filter:blur(12px)
  }
  .timeline-year-nav::-webkit-scrollbar{display:none}
  .timeline-year-nav button{flex:0 0 auto!important;font-size:10px!important;padding:4px 7px!important;min-height:26px!important}
  .timeline-year-nav button:hover,.timeline-year-nav button.is-active{font-size:10px!important;background:#fff!important}

  /* Summary cards scroll horizontally rather than consuming most of the screen. */
  .timeline-summary-wrap{width:100%!important;margin:10px 0 14px!important;padding:0 10px!important;overflow:hidden}
  .timeline-summary-primary{
    display:flex!important;overflow-x:auto!important;scroll-snap-type:x proximity;scrollbar-width:none;
    border-radius:10px!important
  }
  .timeline-summary-primary::-webkit-scrollbar{display:none}
  .timeline-stat{flex:0 0 126px!important;min-width:126px!important;padding:11px 10px!important;scroll-snap-align:start}
  .timeline-stat + .timeline-stat{border-left:1px solid #ececf1!important;border-top:0!important}
  .timeline-stat::before{width:30px!important;height:30px!important;font-size:14px!important}
  .timeline-stat strong{font-size:17px!important}.timeline-stat span{font-size:10px!important}

  /* Timeline becomes a true one-column phone timeline. */
  .timeline{padding:2px 0 10px!important}
  .timeline:before{left:12px!important}
  .year-row{justify-content:flex-start!important;padding-left:0!important;margin:8px 0!important}
  .year-pill{margin-left:0!important;font-size:11px!important}
  .event{display:block!important;padding-left:27px!important;margin:0 0 10px!important;min-height:0!important}
  .event .slot{width:100%!important;min-width:0!important}
  .dot{left:12px!important;top:19px!important}
  .event.milestone .dot{top:24px!important}
  .event-details::part(details),.event-details.feature::part(details){border-radius:12px!important}
  .event-details::part(content),.event-details.feature::part(content){padding:0 11px 12px!important;font-size:12px!important}
  .card-head,.event-details.feature .card-head{padding:10px!important;gap:9px!important;min-width:0!important}
  .card-side,.event-details.feature .card-side{width:78px!important;flex-basis:78px!important;gap:6px!important}
  .timeline-feature-thumb,.event-details.feature .timeline-feature-thumb{width:72px!important;height:56px!important;border-radius:9px!important}
  .timeline-feature-thumb.is-video,.event-details.feature .timeline-feature-thumb.is-video{height:auto!important}
  .title,.event-details.feature .title{font-size:14px!important;line-height:1.25!important}
  .date,.event-details.feature .date{font-size:10px!important}
  .summary-excerpt,.event-details.feature .summary-excerpt{font-size:11.5px!important;line-height:1.4!important;margin-top:6px!important}
  .event-action-row,.parent-action-row,.subevent-meta{gap:5px!important;flex-wrap:wrap!important}
  .timeline-launch{min-height:34px!important;padding:0 10px!important;font-size:11px!important}
  .timeline-delete-button{min-height:30px!important;padding:4px 7px!important}

  /* Loaded child events and galleries are full-width and touch friendly. */
  .timeline .parent-subevent-block{margin:8px 0 0!important;width:100%!important;padding:0!important}
  .subevent-item,.timeline .subevent-item{grid-template-columns:16px 62px minmax(0,1fr)!important;gap:6px!important}
  .subevent-date{font-size:9.5px!important}
  .timeline .subevent-main{grid-template-columns:64px minmax(0,1fr)!important;gap:8px!important}
  .timeline .subevent-thumb-slot{width:64px!important}
  .timeline .subevent-thumb{width:64px!important;height:50px!important}
  .subevent-title{font-size:12.5px!important}
  .subevent-main p{font-size:11px!important;line-height:1.38!important}
  .timeline .subevent-gallery{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:5px!important}
  .timeline .subevent-gallery-thumb{width:100%!important;height:auto!important;aspect-ratio:4/3!important}
  .subevent-youtube-list{grid-template-columns:1fr!important}
  .subevent-youtube{width:100%!important;max-width:none!important}
  .timeline-media-strip{overflow-x:auto!important;flex-wrap:nowrap!important;padding-bottom:4px!important;scrollbar-width:none}
  .timeline-media-strip::-webkit-scrollbar{display:none}
  .timeline-media-thumb{flex:0 0 110px!important;width:110px!important;height:82px!important}
  .timeline-youtube{flex:0 0 min(86vw,330px)!important;width:min(86vw,330px)!important}
  .timeline-back-top{right:10px!important;bottom:76px!important;min-width:54px!important;height:36px!important;padding:0 10px!important;font-size:11px!important}

  /* Event detail and public media. */
  .detail-shell{padding-left:10px!important;padding-right:10px!important;width:100%!important}
  .detail-card h1{font-size:24px!important}.detail-header{max-width:none!important}
  .event-media-toolbar{align-items:flex-start!important;gap:10px!important}
  .media-file-list{grid-template-columns:1fr!important}
  .media-file-list li{padding:10px!important}

  /* Releases: tab strip, tracks, media and lyrics all fit phone width. */
  .catalogue-card{margin-top:12px!important;padding-top:12px!important}
  .catalogue-card-head{display:block!important}
  .catalogue-links{margin-top:8px!important}
  .catalogue-tabs{overflow-x:auto!important;white-space:nowrap!important;scrollbar-width:none!important;overscroll-behavior-x:contain}
  .catalogue-tabs::-webkit-scrollbar{display:none}
  .catalogue-tab{flex:0 0 auto!important;padding:8px 9px!important}
  .catalogue-track{grid-template-columns:24px minmax(0,1fr) auto!important;gap:7px!important;padding:8px 0!important}
  .catalogue-track-number{font-size:10px!important}
  .catalogue-track-main{gap:7px!important}.catalogue-track-title{font-size:12.5px!important}
  .catalogue-track>a{font-size:10px!important}
  .catalogue-progress{grid-column:1/-1!important;margin:0!important;grid-template-columns:36px minmax(0,1fr) 36px!important;gap:5px!important}
  .catalogue-video-grid{grid-template-columns:1fr!important;gap:10px!important}
  .catalogue-video{max-width:none!important}.catalogue-video .youtube-play{width:100%!important}
  .catalogue-lyrics-head{align-items:flex-start!important}.catalogue-edit-lyrics{font-size:10px!important}

  /* General admin/forms. */
  .admin-head{display:flex!important;flex-direction:column!important;align-items:flex-start!important;gap:8px!important}
  .admin-grid,.field-grid,.new-event-grid,.summary-grid,.profile-visibility-grid,.review-grid,.intake-create-grid{
    grid-template-columns:1fr!important
  }
  .field-grid .wide{grid-column:auto!important}
  .admin-card,.admin-panel,.user-panel,.user-list,.profile-box{border-radius:10px!important}
  .events-filters{display:grid!important;grid-template-columns:1fr 1fr!important;width:100%!important}
  .events-filters>*{min-width:0!important;width:100%!important}
  .media-library-filters{grid-template-columns:1fr!important}
  .media-event-filter,.media-move-picker{min-width:0!important}
  .media-library-toolbar,.media-admin-toolbar,.bulk-toolbar,.archive-actions{flex-wrap:wrap!important;align-items:stretch!important}
  .archive-actions{bottom:76px!important}
  .profile-pages{gap:8px!important}.profile-pages label{min-height:32px!important}

  /* Tables remain usable without crushing columns. */
  .admin-shell table,.users-shell table{display:block!important;width:100%!important;overflow-x:auto!important;-webkit-overflow-scrolling:touch}
  .admin-shell th,.admin-shell td{white-space:nowrap}

  /* Media library cards/filters. */
  .media-manage-grid,.media-library-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important;gap:8px!important}
  .media-gallery-grid{grid-template-columns:repeat(2,minmax(0,1fr))!important}
  .media-library-audio-row{min-width:0!important}

  /* Dialogs become phone sheets. */
  dialog,.delete-dialog,.intake-create-dialog{max-width:calc(100vw - 16px)!important;width:calc(100vw - 16px)!important;max-height:calc(100vh - 90px)!important;margin:auto!important}
}

@media(max-width:560px){
  .timeline-simple-header{grid-template-columns:auto minmax(0,1fr)!important}
  .timeline-page-actions{grid-row:2;grid-column:1/-1!important;justify-content:flex-start!important;overflow-x:auto!important}
  .timeline-search-form{grid-column:2!important;grid-row:1!important}
  .timeline-year-nav{top:86px!important}
  html{scroll-padding-top:128px}
  .timeline-summary-wrap{margin-top:8px!important}

  .card-head,.event-details.feature .card-head{display:grid!important;grid-template-columns:68px minmax(0,1fr)!important}
  .card-side,.event-details.feature .card-side{width:68px!important;flex-basis:auto!important}
  .timeline-feature-thumb,.event-details.feature .timeline-feature-thumb{width:64px!important;height:50px!important}

  .subevent-item,.timeline .subevent-item{grid-template-columns:14px minmax(0,1fr)!important}
  .subevent-date{grid-column:2!important;margin-bottom:1px!important}
  .timeline .subevent-main{grid-column:2!important;grid-template-columns:54px minmax(0,1fr)!important}
  .timeline .subevent-thumb-slot{width:54px!important}.timeline .subevent-thumb{width:54px!important;height:44px!important}

  .events-filters{grid-template-columns:1fr!important}
  .media-manage-grid,.media-library-grid,.media-gallery-grid{grid-template-columns:1fr!important}
  .app-mobile-nav-link{flex-basis:58px;min-width:58px;font-size:9px}
  .history-player-companion{bottom:150px!important}
}

/* =============================================================
   Mobile Timeline hotfix — 2026-08-19
   Remove nested desktop grid constraints from child events.
   ============================================================= */
@media(max-width:760px){
  body.app-has-rail .shell{
    width:100%!important;
    max-width:100%!important;
    padding-left:8px!important;
    padding-right:8px!important;
    box-sizing:border-box!important;
  }

  /* Phone header: actions stay compact, search gets a real row. */
  .timeline-simple-header{
    grid-template-columns:minmax(0,1fr) auto!important;
    grid-template-rows:auto auto!important;
    gap:6px 8px!important;
    padding:7px 9px!important;
  }
  body.app-has-rail .timeline-simple-header h1{
    grid-column:1!important;
    grid-row:1!important;
    font-size:18px!important;
  }
  .timeline-page-actions{
    grid-column:2!important;
    grid-row:1!important;
    width:auto!important;
    justify-content:flex-end!important;
    overflow:visible!important;
  }
  .timeline-search-form{
    grid-column:1 / -1!important;
    grid-row:2!important;
    width:100%!important;
    min-width:0!important;
  }
  .timeline-search-form .search-input{
    width:100%!important;
    height:36px!important;
  }
  .timeline-year-nav{top:88px!important;}
  html{scroll-padding-top:134px!important;}

  /* Full-width phone timeline. */
  .timeline{
    width:100%!important;
    max-width:100%!important;
    padding-left:0!important;
    padding-right:0!important;
  }
  .event{
    width:100%!important;
    box-sizing:border-box!important;
    padding-left:22px!important;
  }
  .timeline:before{left:8px!important;}
  .dot{left:8px!important;}

  /* Child timeline: only the timeline dot gets its own column. */
  .timeline .parent-subevent-block{
    width:100%!important;
    max-width:100%!important;
    box-sizing:border-box!important;
    padding:8px!important;
    transform:none!important;
  }
  .timeline .parent-subevent-block .subevent-timeline{
    width:100%!important;
    min-width:0!important;
    padding:0!important;
  }
  .timeline .subevent-item,
  .subevent-item{
    width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    grid-template-columns:14px minmax(0,1fr)!important;
    grid-template-rows:auto auto!important;
    column-gap:6px!important;
    row-gap:2px!important;
  }
  .subevent-dot{
    grid-column:1!important;
    grid-row:1 / span 2!important;
    margin-left:3px!important;
  }
  .subevent-date{
    grid-column:2!important;
    grid-row:1!important;
    padding:5px 0 2px!important;
    width:auto!important;
  }
  .timeline .subevent-main,
  .subevent-main{
    grid-column:2!important;
    grid-row:2!important;
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
    padding:9px!important;
  }
  .timeline .subevent-thumb-slot,
  .subevent-thumb-slot{
    display:block!important;
    width:100%!important;
    min-width:0!important;
    margin:0 0 8px!important;
  }
  .timeline .subevent-thumb,
  .subevent-thumb{
    display:block!important;
    width:100%!important;
    max-width:100%!important;
    height:auto!important;
    aspect-ratio:16/9!important;
  }
  .timeline .subevent-thumb-empty,
  .subevent-thumb-empty{
    display:none!important;
  }
  .timeline .subevent-copy,
  .subevent-copy{
    display:block!important;
    grid-column:auto!important;
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
  }
  .timeline .subevent-main p,
  .subevent-main p{
    width:100%!important;
    max-width:none!important;
    overflow-wrap:anywhere!important;
    word-break:normal!important;
    font-size:11.5px!important;
    line-height:1.45!important;
  }
  .subevent-title{
    display:block!important;
    width:100%!important;
    font-size:13px!important;
  }
  .subevent-audio-list,
  .timeline .subevent-audio-list,
  .subevent-audio-item,
  .timeline .subevent-audio-item{
    width:100%!important;
    max-width:100%!important;
    min-width:0!important;
    box-sizing:border-box!important;
  }
}

@media(max-width:380px){
  .timeline-page-action{padding:0 6px!important;font-size:8.5px!important;}
  body.app-has-rail .timeline-simple-header h1{font-size:17px!important;}
  .app-mobile-nav-link{min-width:52px!important;flex-basis:52px!important;}
}

/* =============================================================
   Mobile viewport cleanup — 2026-10-02
   The timeline has accumulated several responsive layers. These
   final rules resolve the remaining phone-width collisions without
   changing the desktop composition or the timeline data model.
   ============================================================= */
@media(max-width:760px){
  html{scroll-padding-top:134px;}
  body.app-has-rail{
    padding-left:0!important;
    padding-right:0!important;
    padding-bottom:max(76px,calc(70px + env(safe-area-inset-bottom)))!important;
    overflow-x:hidden!important;
  }

  /* Keep the phone toolbar inside the viewport while letting its
     secondary actions remain reachable with a thumb swipe. */
  .timeline-simple-header{
    width:100%!important;
    box-sizing:border-box!important;
    padding-left:max(10px,env(safe-area-inset-left))!important;
    padding-right:max(10px,env(safe-area-inset-right))!important;
  }
  .timeline-page-actions{
    min-width:0!important;
    max-width:100%!important;
    overflow-x:auto!important;
    overflow-y:hidden!important;
    scrollbar-width:none!important;
    overscroll-behavior-x:contain;
  }
  .timeline-page-actions::-webkit-scrollbar{display:none;}
  .timeline-subject-form,
  .timeline-subject-form select,
  .timeline-page-action{flex:0 0 auto!important;}
  .timeline-subject-form select{
    min-width:132px!important;
    width:132px!important;
    min-height:40px!important;
    height:40px!important;
    font-size:12px!important;
  }
  .timeline-page-action{min-height:40px!important;}
  .timeline-subject-context{max-width:180px;overflow:hidden;text-overflow:ellipsis;}
  .timeline-related-subjects{max-width:240px;overflow-x:auto;}

  /* These sections are intentionally wider on desktop; on a phone
     they must be contained so the page itself never gains a second
     horizontal scroll axis. */
  .related-timeline-lanes{
    width:100%!important;
    max-width:none!important;
    margin:20px 0 48px!important;
  }
  .connected-lanes{
    width:100%!important;
    max-width:100%!important;
    margin:20px 0 28px!important;
    border-radius:10px!important;
  }
  .connected-lanes-heading{padding:14px 12px!important;}
  .connected-preview-tray{padding:12px!important;min-height:112px;height:112px!important;}
  .connected-axis{grid-template-columns:92px minmax(0,1fr)!important;padding:0 8px!important;}
  .connected-lane{grid-template-columns:92px minmax(0,1fr)!important;}
  .connected-lane-label{padding:10px 8px!important;overflow-wrap:anywhere;}
  .connected-lane-track{margin:10px 8px!important;min-width:220px;}
  .connected-history-legend{padding:10px 12px!important;gap:8px 14px!important;}
  .related-lane summary{padding:12px!important;align-items:flex-start!important;}
  .related-lane-summary-counts{flex-wrap:wrap;justify-content:flex-end;}

  /* Give touch users a reliable tap target for the timeline controls. */
  .timeline-year-nav button,
  .timeline-delete-button,
  .subevent-gallery-toggle,
  .timeline-launch{min-height:40px!important;}
  .timeline-back-top{bottom:max(76px,calc(70px + env(safe-area-inset-bottom)))!important;}
}

@media(max-width:560px){
  .timeline-simple-header{
    grid-template-columns:minmax(0,1fr) auto!important;
    width:100%!important;
    max-width:100%!important;
    overflow:hidden!important;
  }
  .timeline-simple-header h1{min-width:0!important;overflow:hidden!important;text-overflow:ellipsis!important;}
  .timeline-page-actions{
    max-width:none!important;
    min-width:0!important;
    overflow:visible!important;
  }
  .timeline-page-actions .timeline-related-subjects{display:none!important;}
  .timeline-subject-context{display:none;}
  .timeline-subject-form select{width:128px!important;min-width:128px!important;}
  .timeline-summary-wrap{padding-left:0!important;padding-right:0!important;}
  .related-lane summary span{max-width:42vw;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
}

/* Event detail opened from the timeline: use the whole phone viewport.
   The detail page is loaded in an iframe, so the dialog and the embedded
   page both need explicit mobile sizing to avoid a clipped desktop sheet. */
@media(max-width:760px){
  .event-modal{
    position:fixed!important;
    inset:0!important;
    width:100vw!important;
    max-width:none!important;
    height:100dvh!important;
    max-height:none!important;
    margin:0!important;
    border-radius:0!important;
  }
  .event-modal-frame{grid-template-rows:auto minmax(0,1fr)!important;}
  .event-modal-bar{
    min-height:56px!important;
    padding:8px max(10px,env(safe-area-inset-right)) 8px max(10px,env(safe-area-inset-left))!important;
    gap:8px!important;
  }
  .event-modal-back{
    min-height:44px!important;
    max-width:calc(100vw - 96px)!important;
    padding:0 10px!important;
    overflow:hidden!important;
    text-overflow:ellipsis!important;
    white-space:nowrap!important;
  }
  .event-modal-close{width:44px!important;height:44px!important;}
  .event-modal-content{min-width:0!important;min-height:0!important;overflow:auto!important;}

  .event-embedded .detail-shell-embedded{
    width:100%!important;
    max-width:none!important;
    box-sizing:border-box!important;
    padding:10px max(10px,env(safe-area-inset-right)) max(32px,calc(24px + env(safe-area-inset-bottom))) max(10px,env(safe-area-inset-left))!important;
  }
  .event-embedded .detail-card{width:100%!important;margin-top:0!important;}
  .event-embedded .detail-card::part(base){border-radius:12px!important;}
  .event-embedded .detail-header h1{font-size:26px!important;overflow-wrap:anywhere!important;}
  .event-embedded .detail-header-actions .app-action-button{min-height:44px!important;}
  .event-embedded .media-gallery,
  .event-embedded .media-feature,
  .event-embedded .media-audio,
  .event-embedded .media-documents,
  .event-embedded .media-youtube{min-width:0!important;max-width:100%!important;}

  /* Embedded event pages keep the same mobile navigation as the timeline. */
  .event-embedded{
    padding-bottom:max(76px,calc(70px + env(safe-area-inset-bottom)))!important;
  }
  .event-embedded .app-mobile-nav{display:flex!important;}
  body.event-embedded.history-player-active{padding-bottom:150px!important;}
  .event-embedded .history-global-player{
    bottom:max(68px,calc(62px + env(safe-area-inset-bottom)))!important;
  }
  .event-embedded .history-player-companion{
    bottom:calc(154px + env(safe-area-inset-bottom))!important;
  }

  /* The modal back control is a navigation affordance, not a primary
     action; keep it compact so the event title still has room. */
  .event-modal-back{
    min-height:40px!important;
    padding:0 9px!important;
    font-size:12px!important;
    letter-spacing:-.01em!important;
  }
}


/* Mobile: remove year navigator entirely. */
@media(max-width:760px){
  .timeline-year-nav{display:none!important;}
}

/* Search results are a separate view and must not inherit timeline/card sizing. */
body.timeline-search-active #timelineMain{display:none!important;}
body.timeline-search-active #timelineYearNav{display:none!important;visibility:hidden!important;}
body.timeline-search-active #timelineSearchResults{display:block!important;}
body.timeline-search-active #timelineSearchResults .timeline-search-result{
  display:grid!important;
  grid-template-columns:96px minmax(0,1fr) auto!important;
  width:100%!important;
  height:auto!important;
  min-height:104px!important;
  max-height:none!important;
  padding:14px 16px!important;
  align-items:start!important;
  overflow:visible!important;
  box-sizing:border-box!important;
  line-height:normal!important;
}
body.timeline-search-active #timelineSearchResults .timeline-search-result{background:var(--surface,#fff)!important;border:1px solid var(--border,#e1e2e8)!important;border-radius:16px!important;box-shadow:0 8px 24px rgba(35,36,70,.06)!important;text-align:left!important;color:var(--ink,#111)!important;cursor:pointer!important;}
body.timeline-search-active #timelineSearchResults .timeline-search-result:hover{border-color:#c5c6d5!important;box-shadow:0 10px 28px rgba(35,36,70,.1)!important;transform:translateY(-1px);}
body.timeline-search-active #timelineSearchResults .timeline-search-result-thumb{
  width:96px!important;height:76px!important;max-height:none!important;object-fit:cover!important;
}
body.timeline-search-active #timelineSearchResults .timeline-search-result-body{
  display:flex!important;height:auto!important;min-height:0!important;max-height:none!important;
  overflow:visible!important;white-space:normal!important;
}
body.timeline-search-active #timelineSearchResults .timeline-search-result-title,
body.timeline-search-active #timelineSearchResults .timeline-search-result-summary{
  white-space:normal!important;overflow:visible!important;overflow-wrap:anywhere!important;
}

/* Search results use the same compact two-column card proportions as the
   current staggered timeline cards. */
@media(min-width:761px){
  body.timeline-search-active #timelineSearchResults .timeline-search-result-list{
    grid-template-columns:minmax(0,1fr);
    gap:12px;
  }
  body.timeline-search-active #timelineSearchResults .timeline-search-result{
    grid-template-columns:144px minmax(0,1fr) auto!important;
    min-height:132px!important;
    padding:14px!important;
    border-radius:12px!important;
    gap:10px!important;
    position:relative!important;
  }
  body.timeline-search-active #timelineSearchResults .timeline-search-result-thumb{
    width:144px!important;
    height:96px!important;
    border-radius:8px!important;
  }
  body.timeline-search-active #timelineSearchResults .timeline-search-result-body{
    gap:5px!important;
    padding-right:30px;
  }
  body.timeline-search-active #timelineSearchResults .timeline-search-result-arrow{
    position:absolute;
    top:50%;
    right:12px;
    transform:translateY(-50%);
    font-size:24px;
  }
}

.detail-header-actions{
  display:flex;
  justify-content:flex-start;
  margin:0 0 12px;
}
body.timeline-pending-focus #timelineMain{visibility:hidden!important;}
body.timeline-years-loading .timeline-year-nav{visibility:hidden!important;pointer-events:none!important;}
.timeline-is-jumping #timelineMain{overflow-anchor:none;}
.subevent-item[id^="timeline-event-"],
[data-timeline-event][id^="timeline-event-"]{scroll-margin-top:78px;}
.timeline .subevent-item-compact .subevent-main p{
  display:-webkit-box!important;-webkit-box-orient:vertical!important;-webkit-line-clamp:3!important;
  overflow:hidden!important;white-space:normal!important;
}
.timeline .subevent-timeline-compact{
  display:block;position:relative;padding:4px 2px!important;
}
.timeline .subevent-timeline-compact::before{display:block!important;left:50%!important;top:0!important;bottom:0!important;background:#d9d9e2!important;}
.timeline .subevent-item-compact{
  display:grid;grid-template-columns:1fr;gap:5px;width:calc(50% - 18px);min-width:0;margin:0 0 9px;cursor:pointer;
}
.timeline .subevent-item-compact:nth-child(odd){margin-right:auto;}
.timeline .subevent-item-compact:nth-child(even){margin-left:auto;}
.timeline .subevent-item-compact .subevent-dot{display:none!important;}
.timeline .subevent-item-compact .subevent-date{padding:0 3px;font-size:10.5px;}
.timeline .subevent-item-compact .subevent-main{
  position:relative;display:flex;flex-direction:column;height:100%;min-height:140px;padding:10px;
  transition:border-color .16s ease,box-shadow .16s ease,transform .16s ease;
}
.timeline .subevent-item-compact .subevent-content{display:grid;grid-template-columns:112px minmax(0,1fr);gap:10px;min-width:0;}
.timeline .subevent-item-compact .subevent-copy{min-width:0;padding-right:48px;}
.timeline .subevent-item-compact .event-type-watermark{
  position:absolute;z-index:0;top:11px;right:12px;width:40px;height:40px;pointer-events:none;color:#6f70b7;opacity:.24;
}
.timeline .subevent-item-compact .event-type-watermark svg{display:block;width:100%;height:100%;fill:none;stroke:currentColor;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.timeline .subevent-item-compact .subevent-content,.timeline .subevent-item-compact .subevent-footer{position:relative;z-index:1;}
.timeline .subevent-item-compact:hover .subevent-main{
  border-color:#c9c8ee;box-shadow:0 8px 20px rgba(40,40,70,.08);transform:translateY(-1px);
}
.timeline .subevent-item-compact .subevent-thumb-slot{width:112px;min-width:112px;}
.timeline .subevent-item-compact .subevent-thumb{width:112px;height:84px;}
.timeline .subevent-item-compact .subevent-footer{display:flex;align-items:flex-end;justify-content:space-between;gap:10px;margin-top:auto;padding-top:9px;}
.timeline .subevent-item-compact .subevent-meta{display:flex;align-items:center;gap:5px;min-width:0;margin:0;}
.timeline .subevent-item-compact .subevent-meta .event-type-control{
  display:inline-flex;align-items:center;min-height:27px;padding:4px 9px;border:1px solid #c9c9ff;border-radius:8px;
  color:#5152cf;font-size:10.5px;font-weight:700;background:#f2f2ff;box-shadow:0 1px 2px rgba(55,55,105,.035);
}
.timeline .subevent-item-compact .media-stat{
  display:inline-flex;align-items:center;gap:5px;min-height:27px;padding:4px 9px;border:1px solid #dedee8;border-radius:8px;
  color:#4f5060;font-size:10.5px;font-weight:600;background:#fff;box-shadow:0 1px 2px rgba(35,35,55,.035);
}
.timeline .subevent-item-compact .media-stat b{font-size:11.5px;color:#22222a;}
.timeline .subevent-item-compact .media-stat svg{width:15px;height:15px;flex:0 0 15px;fill:none;stroke:#5b5ce2;stroke-width:1.7;stroke-linecap:round;stroke-linejoin:round;}
.timeline .subevent-item-compact .media-stat-audio,
.timeline .subevent-item-compact .media-stat-photo,
.timeline .subevent-item-compact .media-stat-video,
.timeline .subevent-item-compact .media-stat-document{background:#fff;color:#4f5060;}
.timeline .subevent-item-compact .subevent-actions{display:flex;align-items:center;justify-content:flex-end;gap:5px;margin-left:auto;flex:0 0 auto;}
.timeline .subevent-item-compact .subevent-actions a,
.timeline .subevent-item-compact .subevent-actions .timeline-delete-button{
  display:inline-flex;align-items:center;justify-content:center;min-height:27px;padding:4px 9px;border:1px solid #dedee8;border-radius:8px;
  background:#fff;color:#5051bf;text-decoration:none;font:inherit;font-size:10.5px;font-weight:700;line-height:1;cursor:pointer;box-shadow:0 1px 2px rgba(35,35,55,.035);
}
.timeline .subevent-item-compact .subevent-actions a:hover{background:#f5f5ff;border-color:#cfcff0;}
.timeline .subevent-item-compact .subevent-actions .timeline-delete-button{border-color:#f0d4d7;background:#fff8f8;color:#b3333e;}
.timeline .subevent-item-compact .subevent-actions .timeline-delete-button:hover{background:#fff0f1;border-color:#e8bdc2;}
.event-media-browser{display:flex;flex-direction:column;}
.event-media-toolbar{order:0;}
.event-media-browser .media-group-audio{order:1;}
.event-media-browser .media-group-video{order:2;}
.event-media-browser .media-group-photo{order:3;}
.event-media-browser .media-group-document{order:4;}
.event-photo-more{align-self:flex-start;margin-top:12px;min-height:36px;padding:0 14px;border:1px solid #d8d8e2;border-radius:9px;background:#fff;color:#36364a;font-weight:750;cursor:pointer;}
.event-photo-more:hover{background:#f6f6fa;}
.event-modal{width:calc(100vw - 12px);max-width:none;height:calc(100vh - 12px);max-height:none;margin:6px;padding:0;border:0;border-radius:14px;background:#f5f5f7;overflow:hidden;box-shadow:0 18px 60px rgba(15,15,24,.24);}
.event-modal::backdrop{background:rgba(20,20,28,.42);}
.event-modal-frame{display:grid;grid-template-rows:54px minmax(0,1fr);width:100%;height:100%;overflow:hidden;}
.event-modal-bar{display:grid;grid-template-columns:auto minmax(0,1fr) auto;align-items:center;gap:12px;padding:7px 14px;border-bottom:1px solid #dddde5;background:rgba(255,255,255,.96);z-index:2;}
.event-modal-bar>span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;text-align:center;font-size:13px;font-weight:750;color:#4a4a56;}
.event-modal-back,.event-modal-close{border:1px solid #d8d8e2;background:#fff;color:#343442;font:inherit;font-weight:750;cursor:pointer;}
.event-modal-back{min-height:36px;padding:0 13px;border-radius:9px;}
.event-modal-close{width:36px;height:36px;border-radius:999px;font-size:20px;line-height:1;}
.event-modal-back:hover,.event-modal-close:hover{background:#f3f3f7;}
.event-modal-content{display:block;width:100%;height:100%;border:0;background:#f5f5f7;}
body.event-modal-open{overflow:hidden;}
.history-changelog-dialog{width:min(760px,calc(100vw - 24px));max-height:min(820px,calc(100vh - 24px));padding:0;border:0;border-radius:16px;background:#fff;color:var(--ink);box-shadow:0 22px 70px rgba(20,20,30,.28);overflow:hidden}
.history-changelog-dialog::backdrop{background:rgba(20,20,28,.44)}
.history-changelog-frame{display:grid;grid-template-rows:auto minmax(0,1fr);max-height:min(820px,calc(100vh - 24px))}
.history-changelog-frame>header{display:flex;align-items:center;justify-content:space-between;gap:16px;padding:16px 20px;border-bottom:1px solid var(--border);background:#fff}
.history-changelog-frame>header h2{margin:0;font-size:19px}
.history-changelog-frame>header button{width:34px;height:34px;border:1px solid var(--border);border-radius:999px;background:#fff;color:var(--ink);font:inherit;font-size:20px;cursor:pointer}
.history-changelog-body{min-height:0;padding:20px;overflow:auto}
.history-changelog-intro small{color:var(--muted);font-size:11px;font-weight:700}
.history-changelog-intro p{margin:5px 0 16px;color:var(--muted);font-size:13px}
.history-changelog-tabs{display:flex;gap:4px;margin-bottom:4px;border-bottom:1px solid var(--border)}
.history-changelog-tabs button{border:0;border-bottom:2px solid transparent;background:transparent;padding:9px 11px;color:var(--muted);font:inherit;font-size:12px;font-weight:750;cursor:pointer}
.history-changelog-tabs button[aria-selected="true"]{border-bottom-color:var(--accent);color:var(--ink)}
.history-changelog-panel[hidden]{display:none}
.history-release-entry{padding:18px 2px;border-bottom:1px solid var(--border)}
.history-release-entry:last-child{border-bottom:0}
.history-release-entry header{display:grid;grid-template-columns:minmax(0,1fr) auto;gap:4px 16px}
.history-release-entry header>div{display:flex;align-items:center;gap:8px;min-width:0}
.history-release-entry header strong{font-size:15px}
.history-release-entry header>span{grid-column:1;color:var(--ink);font-size:13px;font-weight:650}
.history-release-entry time{grid-column:2;grid-row:1/3;color:var(--muted);font-size:11px;white-space:nowrap}
.history-release-current,.history-roadmap-status{display:inline-flex;border-radius:999px;background:#e8f5ec;color:#1d6b35;padding:3px 7px;font-size:9px;font-weight:800;text-transform:uppercase;letter-spacing:.03em}
.history-release-entry ul{margin:11px 0 0;padding-left:19px;color:#4f505b;font-size:12px;line-height:1.55}
.history-release-entry li+li{margin-top:4px}
.history-roadmap-entry header{display:block}
.history-roadmap-entry p{margin:8px 0 0;color:var(--muted);font-size:12px;line-height:1.5}
.history-roadmap-status{background:#f0f0ff;color:#5556c8}
@media(max-width:600px){.history-changelog-body{padding:16px}.history-release-entry header{display:block}.history-release-entry time{display:block;margin-top:5px}.history-release-entry header>span{display:block;margin-top:5px}}
.event-embedded{min-height:100vh;background:#f5f5f7;}
.event-embedded .app-rail{display:none!important;}
.event-embedded .detail-shell-embedded{width:100%;max-width:none;padding:10px 12px 32px;}
.event-embedded .detail-shell-embedded>.app-page-actions{justify-content:flex-end;margin-bottom:12px;}
@media(max-width:900px){
  .timeline .subevent-timeline-compact::before{left:9px!important;}
  .timeline .subevent-item-compact,.timeline .subevent-item-compact:nth-child(odd),.timeline .subevent-item-compact:nth-child(even){width:100%;margin-left:0;margin-right:0;padding-left:22px;}
  .timeline .subevent-item-compact .subevent-dot,.timeline .subevent-item-compact:nth-child(even) .subevent-dot{display:none!important;}
}
@media(max-width:560px){
  .timeline .subevent-item-compact .subevent-footer{align-items:stretch;flex-direction:column;}
  .timeline .subevent-item-compact .subevent-actions{align-self:flex-end;}
  .timeline .subevent-item-compact .event-type-watermark{width:34px;height:34px;opacity:.2;}
  .timeline .subevent-item-compact .subevent-copy{padding-right:40px;}
}
@media(max-width:760px){
  body.timeline-search-active #timelineSearchResults .timeline-search-result{
    grid-template-columns:64px minmax(0,1fr) auto!important;min-height:88px!important;padding:11px!important;
  }
  body.timeline-search-active #timelineSearchResults .timeline-search-result-thumb{
    width:64px!important;height:64px!important;
  }
}
.attached-audio-select input[type="checkbox"],.media-item-select,#mediaSelectAll{appearance:auto!important;-webkit-appearance:checkbox!important;width:20px!important;height:20px!important;margin:0!important;padding:0!important;accent-color:#5b5ce2;}
.audio-role-control{display:flex;align-items:center;gap:6px;font-size:11px;color:var(--muted);white-space:nowrap}
.audio-role-control select{min-height:30px;padding:4px 24px 4px 8px;border:1px solid #d4d7e2;border-radius:7px;background:#fff;color:inherit;font:inherit}
/* Search cards: allow all text to wrap inside the card. */
body.timeline-search-active #timelineSearchResults .timeline-search-result,
body.timeline-search-active #timelineSearchResults .timeline-search-result-body,
body.timeline-search-active #timelineSearchResults .timeline-search-result-summary,
body.timeline-search-active #timelineSearchResults .timeline-search-result-title{height:auto!important;max-height:none!important;min-height:0!important;overflow:visible!important;white-space:normal!important;overflow-wrap:anywhere!important;word-break:normal!important;}
body.timeline-search-active #timelineSearchResults .timeline-search-result{align-items:start!important;}
