/* Restrained interaction details inspired by 21st.dev's hover and card patterns. */
:root { --ease-polish: cubic-bezier(.22, 1, .36, 1); }
.masthead { position: relative; z-index: 30; }

.header-tools { position: relative; z-index: 20; justify-self: end; display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.header-tools .demo-badge { margin: 0; white-space: nowrap; }
.language-control { position: relative; flex: 0 0 auto; }
.language-control::before { content: '🌐'; position: absolute; inset-inline-start: 10px; top: 50%; transform: translateY(-50%); pointer-events: none; font-size: 13px; }
.language-control select { appearance: none; min-height: 38px; max-width: 142px; padding: 7px 30px 7px 12px; border: 1px solid #dce2f2; border-radius: 12px; background: #fff; color: #304165; font: inherit; font-size: 12px; cursor: pointer; box-shadow: 0 2px 8px rgba(48, 65, 101, .05); }
.language-control::before { z-index: 1; }
.menu-select { position: relative; display: block; min-width: 0; width: 100%; }
.form-grid .menu-field { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 13px; color: #59617a; }
.menu-select > select.menu-select-native { position: absolute; inset: 0; width: 100%; height: 100%; min-height: 0; margin: 0; padding: 0; opacity: 0; pointer-events: none; z-index: -1; }
.menu-select-trigger,
.form-grid .menu-select .menu-select-trigger {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  width: 100%; min-height: 44px; padding: 9px 12px;
  border: 1px solid #d7def0; border-radius: 11px; background: #fff;
  color: #304165; font: inherit; font-weight: 500; text-align: start;
  box-shadow: 0 2px 8px rgba(48, 65, 101, .04); cursor: pointer;
  transition: border-color 180ms ease, background-color 180ms ease, box-shadow 220ms ease;
}
.menu-select-trigger:hover,
.form-grid .menu-select .menu-select-trigger:hover { border-color: #aebdf0; background: #fbfcff; box-shadow: 0 5px 14px rgba(48, 65, 101, .08); transform: none; }
.menu-select.is-open .menu-select-trigger { border-color: #8299e9; box-shadow: 0 0 0 3px rgba(105, 135, 231, .13); }
.menu-select-value { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.menu-select-chevron { width: 8px; height: 8px; flex: 0 0 8px; border-right: 1.8px solid currentColor; border-bottom: 1.8px solid currentColor; transform: rotate(45deg) translateY(-2px); transition: transform 220ms var(--ease-polish); }
.menu-select.is-open .menu-select-chevron { transform: rotate(225deg) translateY(-2px); }
.menu-select-popover {
  position: absolute; z-index: 50; inset-block-start: calc(100% + 7px); inset-inline-end: 0;
  box-sizing: border-box; width: max-content; min-width: 100%; max-width: min(320px, calc(100vw - 32px));
  max-height: min(320px, 55vh); overflow-y: auto; padding: 6px;
  border: 1px solid #e0e6f5; border-radius: 14px; background: #fff;
  box-shadow: 0 18px 40px rgba(36, 52, 104, .16), 0 3px 8px rgba(36, 52, 104, .07);
  animation: menu-appear 220ms var(--ease-polish) both;
}
.menu-select-popover[hidden] { display: none; }
.menu-select.opens-up .menu-select-popover { inset-block-start: auto; inset-block-end: calc(100% + 7px); animation-name: menu-appear-up; }
@keyframes menu-appear { from { opacity: 0; transform: translateY(-7px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes menu-appear-up { from { opacity: 0; transform: translateY(7px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
.menu-select-option,
.form-grid .menu-select .menu-select-option {
  display: flex; align-items: center; justify-content: space-between; gap: 14px;
  width: 100%; min-height: 38px; padding: 8px 11px; border: 0; border-radius: 9px;
  background: transparent; color: #42516e; font: inherit; font-size: 13px;
  line-height: 1.45; text-align: start; white-space: normal; cursor: pointer;
  transition: background-color 160ms ease, color 160ms ease;
}
.menu-select-option:hover,
.menu-select-option:focus-visible,
.form-grid .menu-select .menu-select-option:hover { background: #f0f3ff; color: #2f4aba; transform: none; box-shadow: none; }
.menu-select-option[aria-checked='true'] { background: #edf1ff; color: #2f4aba; font-weight: 700; }
.menu-select-option[aria-checked='true']::after { content: ''; width: 6px; height: 11px; flex: 0 0 6px; border-right: 2px solid #4865ce; border-bottom: 2px solid #4865ce; transform: rotate(45deg); margin-inline-end: 3px; }
.menu-select-option:focus-visible { outline: 2px solid #8ba4ff; outline-offset: -2px; }
.menu-select-option:disabled { opacity: .45; cursor: default; }
.menu-select-language { min-width: 110px; }
.menu-select-language .menu-select-trigger { min-height: 38px; padding-inline-start: 31px; border-radius: 12px; font-size: 12px; }
.menu-select-language .menu-select-popover { min-width: 168px; }
.menu-select:has(#event-select) { margin: 6px 0 20px; }
html[dir='rtl'] .language-control select { padding: 7px 30px 7px 12px; }
html[dir='ltr'] .language-control select { padding: 7px 12px 7px 30px; }
html[dir='ltr'] .masthead nav { direction: ltr; }
html[dir='ltr'] .status-card, html[dir='ltr'] .facts-card, html[dir='ltr'] .page-panel { text-align: left; }
html[lang='ja'] .status-copy h2 { font-size: clamp(34px, 3.8vw, 58px); }

.masthead, .page-intro, .status-card, .facts-card, .quick-actions, .events-section, .page-panel {
  animation: first-arrival 620ms var(--ease-polish) both;
}
.masthead { animation: none; }
.page-intro { animation-delay: 70ms; }
.status-card, .page-panel:first-of-type { animation-delay: 140ms; }
.facts-card, .page-panel:nth-of-type(2) { animation-delay: 210ms; }
.quick-actions, .page-panel:nth-of-type(3) { animation-delay: 280ms; }
.events-section { animation-delay: 350ms; }
@keyframes first-arrival {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: translateY(0); }
}

.masthead nav a,
.masthead nav button {
  transition: color 220ms ease, background-color 220ms ease;
}
.masthead nav a:not(.nav-active):hover,
.masthead nav button:hover { color: #304fdf; }
.masthead nav a::after {
  content: '';
  position: absolute;
  inset-inline-start: 20%;
  inset-inline-end: 20%;
  bottom: 1px;
  width: auto;
  height: 2px;
  border-radius: 2px;
  background: #4061f2;
  transform: scaleX(0);
  transition: transform 260ms var(--ease-polish);
}
.masthead nav a:hover::after,
.masthead nav a.nav-active::after { transform: scaleX(1); }

.status-card { position: relative; overflow: hidden; isolation: isolate; }
.status-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 15% 0%, rgba(255,255,255,.18), transparent 50%);
  opacity: 0;
  pointer-events: none;
  transition: opacity 500ms ease;
}
.status-card:hover::before { opacity: 1; }
.status-card > * { position: relative; }

.card-action,
.quick-action,
.filters button,
.source-link,
.events-demo {
  transition: transform 260ms var(--ease-polish), box-shadow 260ms var(--ease-polish),
    background-color 220ms ease, color 220ms ease, border-color 220ms ease;
}
.card-action:hover { transform: translateY(-2px); box-shadow: 0 8px 18px rgba(13, 32, 104, .18); }
.card-action:active,
.quick-action:active { transform: translateY(0) scale(.985); }
.quick-action:hover { transform: translateY(-3px); box-shadow: 0 11px 24px rgba(59, 75, 129, .1); }
.quick-action .round-icon,
.quick-action .action-arrow,
.card-action svg { transition: transform 280ms var(--ease-polish); }
.quick-action:hover .round-icon { transform: scale(1.08); }
.quick-action:hover .action-arrow,
.card-action:hover svg { transform: translateX(-3px); }
.filters button:hover:not(.is-selected) { background: #e9edff; color: #304fdf; }
.filters button:active { transform: scale(.96); }
.filters button.is-selected { color: #2f49aa; box-shadow: 0 3px 10px rgba(58, 81, 153, .13); }
.event-row { position: relative; transition: background-color 220ms ease; animation: list-enter 390ms var(--ease-polish) both; }
.event-row:nth-child(2), .archive-row:nth-child(2) { animation-delay: 45ms; }
.event-row:nth-child(3), .archive-row:nth-child(3) { animation-delay: 90ms; }
.event-row:nth-child(n+4), .archive-row:nth-child(n+4) { animation-delay: 120ms; }
@keyframes list-enter { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: translateY(0); } }
.event-row:hover { background-color: rgba(241, 244, 255, .55); }
.event-row[data-stage='announced'] .event-icon { background: #eef1ff; color: #4865ce; }
.event-row[data-stage='distributing'] .event-icon,
.event-row[data-stage='reported_completed'] .event-icon { background: #fff7e6; color: #987329; }
.event-row[data-stage='completed'] .event-icon { background: #e9f8f2; color: #2c8060; }
.event-row[data-stage='announced'] .event-state { background: #edf1ff; color: #3553ad; }
.event-row[data-stage='distributing'] .event-state,
.event-row[data-stage='reported_completed'] .event-state { background: #fff7e6; color: #795c23; }
.event-row[data-stage='completed'] .event-state { background: #e8f6ef; color: #287452; }
.event-state { font-weight: 600; }
.facts-card, .page-panel, .events-list { border: 1px solid #e9edf7; }
.methodology-page main { counter-reset: method-section; }
.methodology-page .page-panel { counter-increment: method-section; }
.methodology-page .page-panel h2 { display: flex; align-items: center; gap: 12px; }
.methodology-page .page-panel h2::before { content: '0' counter(method-section); display: inline-grid; place-items: center; width: 34px; height: 34px; flex: 0 0 34px; border-radius: 10px; background: #edf1ff; color: #3f5ec7; font-size: 13px; font-weight: 700; font-variant-numeric: tabular-nums; }
.health-grid > div { padding: 14px 16px; background: #f8faff; border: 1px solid #e9eef9; border-radius: 14px; }
#latest-signal .signal-quote { width: min(100%, 720px); margin: 18px auto 0; padding: 20px 22px 16px; border: 1px solid #e0e6f4; border-radius: 20px; background: #fff; box-shadow: 0 12px 30px rgba(34, 54, 112, .07); }
.signal-quote-head { display: flex; align-items: center; gap: 12px; }
.signal-platform-mark { display: grid; place-items: center; width: 44px; height: 44px; flex: none; border-radius: 13px; color: #fff; background: #121827; }
.signal-platform-mark[hidden], .signal-author-handle[hidden] { display: none; }
.signal-platform-mark svg { width: 22px; height: 22px; fill: currentColor; stroke: none; }
.signal-author { display: grid; gap: 2px; min-width: 0; line-height: 1.35; }
.signal-author strong { color: #1b2541; font-size: 15px; font-weight: 700; }
.signal-author span { color: #72809a; font-size: 12px; text-align: start; }
.signal-platform-name { margin-inline-start: auto; align-self: flex-start; color: #808ba3; font-size: 12px; font-weight: 700; }
#latest-signal #signal-text { margin: 18px 0 16px; padding: 0; border: 0; background: none; color: #1b2541; font-size: 15px; line-height: 1.9; white-space: pre-wrap; overflow-wrap: anywhere; }
.signal-quote-foot { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 8px 16px; padding-top: 12px; border-top: 1px solid #edf0f7; color: #7b86a0; font-size: 12px; }
.signal-quote-foot .source-link { margin: 0; font-size: 12px; }
#latest-signal .translation-tools { width: min(100%, 720px); margin: 12px auto 0; }
@media (max-width: 480px) { #latest-signal .signal-quote { padding: 17px 16px 14px; border-radius: 16px; } #latest-signal #signal-text { font-size: 14px; } }
.archive-row { border-inline-start: 3px solid #c8d2f5; padding-inline-start: 18px; margin: 12px 0; border-bottom: 0; border-radius: 3px; animation: list-enter 390ms var(--ease-polish) both; }
.archive-row[data-stage='distributing'], .archive-row[data-stage='reported_completed'] { border-inline-start-color: #dbbd70; }
.archive-row[data-stage='completed'] { border-inline-start-color: #80bfa1; }
.archive-row:hover { background: #f8faff; }
.archive-meta span:first-child { color: #3553ad; background: #eef2ff; padding: 3px 8px; border-radius: 7px; font-weight: 600; }
.archive-row[data-stage='distributing'] .archive-meta span:first-child,
.archive-row[data-stage='reported_completed'] .archive-meta span:first-child { color: #795c23; background: #fff7e6; }
.archive-row[data-stage='completed'] .archive-meta span:first-child { color: #287452; background: #e8f6ef; }
.archive-empty { padding: 4px 0 14px; }
.archive-reset { min-height: 42px; border: 1px solid #ccd7f9; border-radius: 10px; background: #eef2ff; color: #304fba; padding: 8px 16px; font: inherit; font-weight: 600; cursor: pointer; transition: background-color 180ms ease, transform 180ms ease; }
.archive-reset:hover { background: #e2eaff; transform: translateY(-1px); }
#event-select { display: block; width: 100%; min-height: 44px; margin: 6px 0 20px; padding: 10px; border: 1px solid #d7def0; border-radius: 10px; background: #fff; color: #172039; font: inherit; }
.form-grid input, .form-grid select, .form-grid textarea, #event-select { transition: border-color 180ms ease, box-shadow 180ms ease; }
.form-grid input:focus, .form-grid select:focus, .form-grid textarea:focus, #event-select:focus { border-color: #8299e9; box-shadow: 0 0 0 3px rgba(105, 135, 231, .13); }
.form-grid button, .primary-button { transition: background-color 180ms ease, box-shadow 220ms ease, transform 220ms var(--ease-polish); }
.form-grid button:hover, .primary-button:hover { background: #2749d5; box-shadow: 0 8px 16px rgba(43, 74, 192, .16); transform: translateY(-1px); }
.form-grid button:active, .primary-button:active { transform: translateY(0); }
.form-grid button:disabled, .primary-button:disabled { opacity: .6; cursor: wait; transform: none; box-shadow: none; }
.source-link:hover,
.events-demo:hover { color: #243db3; text-underline-offset: 5px; }
.translation-tools { display: flex; align-items: center; flex-wrap: wrap; gap: 8px 16px; margin-top: 12px; color: #69758f; font-size: 12px; }
.translation-tools button { border: 1px solid #dce3f4; background: #f7f9ff; color: #304fbb; border-radius: 9px; min-height: 34px; padding: 6px 11px; font: inherit; font-weight: 600; cursor: pointer; transition: background-color 180ms ease, border-color 180ms ease; }
.translation-tools button:hover { background: #eef2ff; border-color: #bfcbf5; }
.translation-tools button[hidden] { display: none; }

.subscribe-widget { position: absolute; z-index: 45; top: 57px; right: max(148px,calc((100vw - 1192px)/2 + 148px)); display: grid; justify-items: right; max-width: calc(100vw - 24px); }
.subscribe-widget [hidden] { display: none !important; }
.subscribe-toggle { display: inline-flex; align-items: center; gap: 9px; min-height: 42px; padding: 8px 13px; border: 1px solid #dbe3f7; border-radius: 13px; background: #fff; box-shadow: 0 9px 24px rgba(38,58,119,.14); color: #304fb9; font: inherit; font-size: 12px; font-weight: 700; transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease; }
.subscribe-toggle:hover { background: #f8faff; transform: translateY(-2px); box-shadow: 0 12px 28px rgba(38,58,119,.18); }
.subscribe-toggle svg { width: 18px; height: 18px; }
.subscribe-indicator { width: 7px; height: 7px; border-radius: 50%; background: #aab5d3; transition: background 180ms ease; }
.subscribe-widget.is-subscribed .subscribe-indicator { background: #48b493; box-shadow: 0 0 0 3px #e4f8f0; }
.subscribe-card { position: relative; display: grid; gap: 18px; width: min(370px,calc(100vw - 24px)); max-height: calc(100dvh - 116px); overflow-y: auto; margin-top: 10px; padding: 23px; border: 1px solid #dfe6f7; border-radius: 20px; background: linear-gradient(135deg,#fff 30%,#f7f8ff 100%); box-shadow: 0 22px 54px rgba(28,47,110,.2); animation: subscribe-enter 220ms ease both; }
.subscribe-card.is-closing { animation: subscribe-exit 180ms ease both; pointer-events: none; }
@keyframes subscribe-enter { from { opacity: 0; transform: translateY(-8px) scale(.98); } to { opacity: 1; transform: translateY(0) scale(1); } }
@keyframes subscribe-exit { to { opacity: 0; transform: translateY(-8px) scale(.98); } }
.subscribe-close { position: absolute; top: 10px; left: 11px; display: grid; place-items: center; width: 29px; height: 29px; border: 0; border-radius: 9px; background: #eef2fc; color: #6d7894; font-size: 23px; line-height: 1; }
.subscribe-close:hover { background: #e3e9fb; color: #2e4bc1; }
.subscribe-toast { max-width: min(370px,calc(100vw - 24px)); margin-top: 10px; padding: 11px 14px; border: 1px solid #cde9df; border-radius: 12px; background: #f0faf6; box-shadow: 0 10px 25px rgba(34,83,66,.12); color: #287455; font-size: 12px; font-weight: 600; line-height: 1.5; animation: subscribe-enter 220ms ease both; }
.subscribe-toast.is-leaving { animation: subscribe-exit 220ms ease both; }
.subscribe-lead { display: flex; align-items: flex-start; gap: 15px; }
.subscribe-icon { display: grid; place-items: center; width: 38px; height: 38px; flex: none; border-radius: 12px; color: #4662d7; background: #edf1ff; font-size: 21px; }
.subscribe-eyebrow { margin: 0 0 5px; color: #6279bf; font-size: 11px; font-weight: 700; }
.subscribe-lead h2 { margin: 0; color: #1d294a; font-size: 18px; line-height: 1.45; }
.subscribe-lead p:last-child { margin: 7px 0 0; color: #69758d; font-size: 12px; line-height: 1.7; }
.subscribe-controls { min-width: 0; }
.subscribe-options { display: flex; flex-wrap: wrap; gap: 8px; }
.subscribe-options label { display: flex; align-items: center; gap: 7px; min-height: 37px; padding: 6px 11px; border: 1px solid #e2e7f4; border-radius: 11px; background: #fff; color: #3d4a68; font-size: 12px; cursor: pointer; }
.subscribe-options input { width: 16px; height: 16px; margin: 0; accent-color: #4665dc; }
.subscribe-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 8px 14px; margin-top: 11px; }
#subscribe-button { min-height: 40px; padding: 8px 15px; border: 0; border-radius: 11px; background: #3759d7; color: #fff; font: inherit; font-size: 12px; font-weight: 700; transition: background 180ms ease,transform 180ms ease; }
#subscribe-button:hover:not(:disabled) { background: #2848c3; transform: translateY(-1px); }
#subscribe-button:disabled { opacity: .55; cursor: not-allowed; }
#unsubscribe-button { padding: 6px 0; border: 0; background: none; color: #596a91; font: inherit; font-size: 12px; text-decoration: underline; text-underline-offset: 3px; }
.subscribe-telegram { color: #74819d; font-size: 11px; }
a.subscribe-telegram { color: #3153c1; text-decoration: underline; text-underline-offset: 3px; }
#subscribe-status { min-height: 18px; margin: 8px 0 0; color: #78849c; font-size: 11px; line-height: 1.5; }
@media (max-width: 850px) {
  .subscribe-widget { top: 55px; right: 12px; width: min(370px,calc(100vw - 24px)); justify-items: right; }
  .subscribe-toggle { margin-right: 118px; padding-inline: 10px; }
  .subscribe-toggle > span:not(.subscribe-indicator) { display: none; }
}
@media (max-width: 480px) { .subscribe-card { border-radius: 18px; padding: 19px 16px; } .subscribe-icon { width: 36px; height: 36px; font-size: 19px; } .subscribe-lead h2 { font-size: 19px; } .subscribe-lead p:last-child, .subscribe-options label, #subscribe-button { font-size: 13px; } .subscribe-options { flex-direction: column; } #subscribe-status { font-size: 12px; } }

.detail-panel:not([hidden]) { animation: panel-enter 360ms var(--ease-polish) both; }
@keyframes panel-enter {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

:where(a, button, input, select, textarea):focus-visible {
  outline: 3px solid #8ba4ff;
  outline-offset: 3px;
}

@media (hover: none) {
  .status-card::before { display: none; }
  .event-row:hover { background-color: transparent; }
  .archive-row:hover { background: transparent; }
}
@media (max-width: 760px) {
  .header-tools { grid-column: 2; grid-row: 1; }
}
@media (max-width: 480px) {
  .header-tools { flex-direction: column; align-items: flex-end; gap: 5px; }
  .header-tools .demo-badge { font-size: 10px; }
  .language-control select { min-height: 34px; font-size: 11px; }
  .masthead nav { flex-wrap: wrap; justify-content: flex-start; gap: 4px 10px; }
  html[lang='ar'] .masthead nav { flex-wrap: nowrap; justify-content: space-between; gap: 6px; font-size: 12px; }
}
@media (prefers-reduced-motion: reduce) {
  .masthead nav a, .masthead nav button, .status-card::before,
  .card-action, .quick-action, .filters button, .source-link, .events-demo,
  .quick-action .round-icon, .quick-action .action-arrow, .card-action svg,
  .event-row { transition: none !important; }
  .masthead nav a::after, .archive-reset, .form-grid button, .primary-button,
  .form-grid input, .form-grid select, .form-grid textarea, #event-select { transition: none !important; }
  .event-row, .archive-row { animation: none !important; }
  .menu-select-popover { animation: none !important; }
  .menu-select-trigger, .menu-select-chevron, .menu-select-option { transition: none !important; }
  .subscribe-toggle { transition: none !important; }
  .subscribe-card, .subscribe-card.is-closing, .subscribe-toast, .subscribe-toast.is-leaving { animation: none !important; }
  .detail-panel:not([hidden]) { animation: none; }
  .masthead, .page-intro, .status-card, .facts-card, .quick-actions, .events-section, .page-panel { animation: none; }
}
