/* Approved Metona observatory, 2026-11-27. App-owned identity adapter.
   design-exception: the static engraved meridian names the lunisolar date
   context; it is confined to the masthead/unused ledger margin, never data.
   The host calendar adapter remains authoritative inside receiving apps. */
:root { --metona-brass: #cba56b; --metona-ivory: #f4e9d7; --metona-display: Georgia, "Times New Roman", serif; }
:root:not([data-calendar-host]) body { background: #1d171c; }
:root:not([data-calendar-host]) body::before {
  background: radial-gradient(65vw 50vw at 10% 2%, #80527638, transparent 70%), radial-gradient(45vw 50vw at 90% 80%, #926b352b, transparent 70%);
}
:root:not([data-calendar-host]) body::after { opacity: .08; }
:root:not([data-calendar-host]) :is(.stage,.sidebar,.day-ledger) { backdrop-filter: none; -webkit-backdrop-filter: none; }
:root:not([data-calendar-host]) .horizon { background: #281b24bd; border-bottom: 1px solid #cba56b80; box-shadow: inset 0 1px #f4e9d72e; }
:root:not([data-calendar-host]) .horizon::before { background: radial-gradient(70% 16px at 20% 0, #f4e9d71a, transparent 90%); }
:root:not([data-calendar-host]) .sidebar { background: #2c1d286e; box-shadow: none; border-color: var(--rule); }
:root:not([data-calendar-host]) .stage { background: #21181ede; box-shadow: none; }
:root:not([data-calendar-host]) .stage-head {
  min-height: 154px; padding: 22px 28px; gap: 20px; align-items: center;
  background-color: #2c1d28; background-image: url("observatory.svg");
  background-size: 610px auto; background-position: 30% 8px; background-repeat: no-repeat;
  border-bottom: 1px solid #cba56b66;
}
:root:not([data-calendar-host]) .period { min-width: 0; flex: 1; position: relative; }
:root:not([data-calendar-host]) .period:has(.period-figure:not([hidden])) {
  display: grid; grid-template-columns: auto minmax(0,1fr); align-items: center; column-gap: 18px;
}
.period-figure { grid-column: 1; grid-row: 1 / 3; font: 84px/.94 var(--metona-display); letter-spacing: -.065em; color: var(--metona-ivory); }
.period-figure[hidden] { display: none; }
:root:not([data-calendar-host]) .period h1 { font: 36px/1.1 var(--metona-display); letter-spacing: -.035em; color: var(--ink); }
:root:not([data-calendar-host]) .period:has(.period-figure:not([hidden])) :is(h1,.period-sub) { grid-column: 2; }
:root:not([data-calendar-host]) .period-sub { margin-top: 9px; color: var(--ink-2); letter-spacing: .12em; }
:root:not([data-calendar-host]) .views { border: 0; border-radius: 0; background: transparent; gap: 2px; overflow: visible; }
:root:not([data-calendar-host]) .views a { padding: 10px 12px; background: transparent; border: 0; border-bottom: 2px solid transparent; }
:root:not([data-calendar-host]) .views a.on { background: transparent; color: var(--ink); border-bottom-color: var(--metona-brass); }
:root:not([data-calendar-host]) .period-nav { flex-shrink: 0; }
:root:not([data-calendar-host]) .period-nav button { background: #20171d70; border-color: #a88a7480; }
:root:not([data-calendar-host]) .mini-head h2 { color: var(--blue); }
:root:not([data-calendar-host]) .mini-day.today { color: var(--ink); border-color: var(--metona-brass); }
:root:not([data-calendar-host]) :is(.tg-head,.tg-allday) { background: #2b1e27; }
:root:not([data-calendar-host]) .day-ledger { background: #2c1d28 url("observatory.svg") right -290px bottom -55px / 650px auto no-repeat; }
:root:not([data-calendar-host]) .day-ledger h2 { color: var(--ink-2); }
:root:not([data-calendar-host]) .charge-total { color: var(--metona-ivory); }
:root:not([data-calendar-host]) .page-head {
  position: relative; isolation: isolate; min-height: 112px; align-items: center;
  padding-block: 16px 24px; border-bottom: 1px solid var(--rule-strong);
  background: url("observatory.svg") right -100px top -5px / 440px auto no-repeat;
}
:root:not([data-calendar-host]) .page-head h1 { font-family: var(--metona-display); font-weight: 400; letter-spacing: -.025em; }
:root:not([data-calendar-host]) .page-head .page-lede { color: var(--ink-2); }
:root:not([data-calendar-host]) .page-head .integration-actions { position: relative; }
:root:not([data-calendar-host]) :is(.integration-tabs,.feature-result) { border-color: var(--rule); }
:root:not([data-calendar-host]) .integration-tabs .on { background: transparent; color: var(--blue); text-decoration: underline; text-underline-offset: 8px; }
:root:not([data-calendar-host]) .integration-row { border-color: var(--rule); }
:root:not([data-calendar-host]) .integration-actions .quiet { background: transparent; border-color: transparent; }
:root:not([data-calendar-host]) :is(.integration-actions .quiet,.type-actions .quiet,.day-ledger>a) { text-decoration: underline; text-underline-offset: 4px; }

/* A single shared command object; destinations are flat, not four pills. */
:root:not([data-calendar-host]) body #appView .dock.app-island {
  padding: 8px 12px; gap: 0; border-color: #d8bfa381; border-radius: 24px;
  background: #2c1d28eb; box-shadow: inset 0 1px #f4e9d74d, 0 12px 32px #0006;
  backdrop-filter: blur(12px) saturate(115%); -webkit-backdrop-filter: blur(12px) saturate(115%);
}
:root:not([data-calendar-host]) .app-island::before { background: radial-gradient(80% 12px at 25% 0, #f4e9d72e, transparent 95%); mask-image: none; -webkit-mask-image: none; }
:root:not([data-calendar-host]) .app-island::after { display: none; }
:root:not([data-calendar-host]) body #appView .app-island a {
  position: relative; min-width: 88px; min-height: 54px; padding: 7px 12px;
  border-radius: 0; color: var(--ink); background: transparent; box-shadow: none;
}
:root:not([data-calendar-host]) body #appView .app-island a+a { border-left: 1px solid var(--rule); }
:root:not([data-calendar-host]) body #appView .app-island a.on { color: var(--blue); background: transparent; box-shadow: none; }
:root:not([data-calendar-host]) .app-island a.on::after { content: ''; position: absolute; bottom: 0; left: 18%; right: 18%; height: 2px; background: var(--metona-brass); }

/* The moon is an action/state, not an idle animated decoration. */
.horizon .header-action .menu-moon { width: 30px; height: 30px; overflow: visible; transition: transform 360ms cubic-bezier(.2,.8,.3,1); }
.moon-disc { fill: var(--ink); transition: fill 240ms ease; }
.moon-shadow { transform-origin: 16px 16px; transition: transform 420ms cubic-bezier(.2,.8,.3,1); }
.moon-orbit { fill: none; stroke: var(--blue); stroke-width: .65; opacity: 0; transform-origin: center; transform: scale(.85); transition: opacity 240ms ease, transform 360ms ease; }
.horizon #menuToggle:hover .moon-disc, .horizon #menuToggle[aria-expanded=true] .moon-disc { fill: var(--blue); }
#menuToggle[aria-expanded=true] .moon-shadow { transform: translate(19px,-7px); }
#menuToggle[aria-expanded=true] .menu-moon { transform: rotate(-14deg); }
#menuToggle[aria-expanded=true] .moon-orbit { opacity: .8; transform: scale(1); }
#menuToggle:active .menu-moon { transform: scale(.88) rotate(-10deg); }
#menuToggle:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; }

/* Warm sign-in/public material and form backing; shared behavior is unchanged. */
:root:not([data-calendar-host]) #authView .threshold-form { --elvn-accent: #e1bf7d; --elvn-accent-rgb: 225,191,125; background: #2c1d28d9; border-color: #cba56b66; }
:root:not([data-calendar-host]) #authView h1 { font: 34px/1.2 var(--metona-display); }
:root:not([data-calendar-host]) .observatory::before { background: radial-gradient(70% 22px at 20% 0, #f4e9d726, transparent 90%); }
:root:not([data-calendar-host]) .observatory { background: #2c1d28d9; border-color: #cba56b55; }

@media (max-width: 1100px) and (min-width: 761px) {
  :root:not([data-calendar-host]) .stage-head { flex-wrap: wrap; gap: 10px 18px; }
  :root:not([data-calendar-host]) .period { flex-basis: calc(100% - 170px); }
  :root:not([data-calendar-host]) .stage-head .views { margin-left: auto; }
}
@media (max-width: 760px) {
  :root:not([data-calendar-host]) .stage-head { display: grid; grid-template-columns: auto minmax(0,1fr); min-height: 0; padding: 18px 16px 12px; gap: 12px 6px; background-size: 460px auto; background-position: center -2px; }
  :root:not([data-calendar-host]) .period { grid-column: 1 / -1; min-height: 76px; }
  :root:not([data-calendar-host]) .period h1 { font-size: 26px; }
  :root:not([data-calendar-host]) .period-sub { margin-top: 6px; font-size: 11px; }
  .period-figure { font-size: 68px; }
  :root:not([data-calendar-host]) .period-nav { margin: 0; }
  :root:not([data-calendar-host]) .period-nav button { min-width: 44px; padding: 6px 8px; }
  :root:not([data-calendar-host]) .views { grid-column: 2; justify-self: end; margin: 0; }
  :root:not([data-calendar-host]) .views a { min-width: 44px; padding: 10px 6px; font-size: 12px; }
  :root:not([data-calendar-host]) body[data-mobile-nav] .sidebar {
    --ink: #f4e9d7; --ink-2: #dccdbc; --muted: #c0aaae; --silver: #e1d8cf;
    --rule: #74585c99; --rule-strong: #a88a74; --wash: #3a2834; --blue: #e1bf7d;
    --field: #20171d; --surface: #2c1d28;
  }
  :root:not([data-calendar-host]) body[data-mobile-surface=glass] .sidebar { background: #2c1d28f5; backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); }
  :root:not([data-calendar-host]) body[data-mobile-surface=solid] :is(.horizon,.sidebar,.stage) { background: var(--surface); backdrop-filter: none; -webkit-backdrop-filter: none; }
  :root:not([data-calendar-host]) body #appView .app-island a { min-width: 0; flex: 1; padding-inline: 3px; min-height: 52px; font-size: 11px; }
  :root:not([data-calendar-host]) body #appView .dock.app-island { max-width: 440px; padding: 7px 8px; }
  :root:not([data-calendar-host]) .page-head { min-height: 110px; align-items: stretch; background-position: right -250px top 0; }
  :root:not([data-calendar-host]) .page-head h1 { font-size: 32px; }
}
@media (max-width: 370px) {
  :root:not([data-calendar-host]) .period h1 { font-size: 23px; }
  :root:not([data-calendar-host]) .period-nav { grid-column: 1 / -1; justify-self: end; }
  :root:not([data-calendar-host]) .views { grid-column: 1 / -1; justify-self: stretch; }
  :root:not([data-calendar-host]) .views a { flex: 1; }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  :root:not([data-calendar-host]) body #appView .dock.app-island { background: var(--surface); }
}
@media (prefers-reduced-transparency: reduce) {
  :root:not([data-calendar-host]) :is(.horizon,.sidebar,.stage,.stage-head,.day-ledger,.page-head,.observatory), :root:not([data-calendar-host]) #authView .threshold-form,
  :root:not([data-calendar-host]) body[data-mobile-surface=glass] .sidebar, :root:not([data-calendar-host]) body #appView .dock.app-island {
    background: var(--surface); background-image: none; backdrop-filter: none; -webkit-backdrop-filter: none; box-shadow: none;
  }
}
@media (prefers-reduced-motion: reduce) {
  .menu-moon, .menu-moon * { transition: none !important; animation: none !important; }
}
@media (forced-colors: active) {
  :root:not([data-calendar-host]) body,
  :root:not([data-calendar-host]) :is(.horizon,.sidebar,.stage,.stage-head,.day-ledger,.page-head,.observatory),
  :root:not([data-calendar-host]) #authView .threshold-form,
  :root:not([data-calendar-host]) body[data-mobile-surface=glass] .sidebar,
  :root:not([data-calendar-host]) body #appView .dock.app-island { background: Canvas; color: CanvasText; border-color: CanvasText; box-shadow: none; backdrop-filter: none; -webkit-backdrop-filter: none; }
  :root:not([data-calendar-host]) :is(.period-figure,.period h1,.mini-head h2,.views a.on), :root:not([data-calendar-host]) body #appView .app-island a { color: CanvasText; }
  :root:not([data-calendar-host]) .app-island a.on::after { background: Highlight; }
  .menu-moon mask, .menu-moon mask * { forced-color-adjust: none; }
  .moon-disc, .horizon #menuToggle[aria-expanded=true] .moon-disc { fill: ButtonText; }
  .moon-orbit { stroke: Highlight; }
  #menuToggle:focus-visible { outline-color: Highlight; }
}
