.psky-sky-stage {
  position: relative;
  width: min(100%, 1280px);
  aspect-ratio: 16 / 9;
  height: auto;
  max-height: calc(100vh - 80px);
  margin: 0;
  border: 1px solid var(--psky-line);
  background: #030303;
  overflow: hidden;
}

@media (max-width: 980px) {
  .psky-workbench {
    display: block;
    width: min(100%, calc(100vw - 24px));
  }

  .psky-workbench-sky {
    margin-top: 24px;
  }
}

/* ============================================================
  Sky viewport corner frame
============================================================ */

.psky-sky-stage::before {
  display: none;
  content: "";
  position: absolute;
  inset: 12px;
  z-index: 20;
  pointer-events: none;
  opacity: 0.42;

  background:
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) left top / 30px 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) left top / 1px 30px no-repeat,

    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) right top / 30px 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) right top / 1px 30px no-repeat,

    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) left bottom / 30px 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) left bottom / 1px 30px no-repeat,

    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) right bottom / 30px 1px no-repeat,
    linear-gradient(rgba(255, 255, 255, 0.4), rgba(255, 255, 255, 0.4)) right bottom / 1px 30px no-repeat;
}

/* ============================================================
  Sky UI overlay
============================================================ */

.psky-sky-ui-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  pointer-events: none;
}


body.is-splash-status-boot .psky-sky-ui-overlay {
  z-index: 60;
}

body.is-splash-status-boot .psky-sky-actions,
body.is-splash-status-boot .psky-sky-bottom-actions,
body.is-splash-status-boot .psky-menu-button,
body.is-splash-status-boot .psky-sky-star-status {
  opacity: 0;
}

/* ============================================================
  Sky overlay text
============================================================ */

.psky-sky-status,
.psky-sky-star-status {
  position: absolute;
  color: rgba(255, 255, 255, 0.58);
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
  pointer-events: none;
}

.psky-sky-status {
  left: 24px;
  top: 24px;
}

.psky-sky-star-status {
  left: 24px;
  bottom: 24px;
  font-size: 10px;
  line-height: 1.55;
  opacity: 0.49;
  white-space: nowrap;
}

.psky-sky-status-title {
  font-size: 54px;
  line-height: 1;
  margin-bottom: 8px;
  color: #efefef;
  opacity: 0.85;
}

.psky-sky-status-line,
.psky-sky-status-build {
  font-size: 10px;
  line-height: 1.75;
  opacity: 0.49;
  white-space: nowrap;
}

.psky-sky-status-build {
  display: none;
}

.psky-sky-star-status[hidden] {
  display: none;
}

/* ============================================================
  Sky actions
============================================================ */

.psky-sky-actions {
  position: absolute;
  right: 24px;
  top: 24px;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 14px;
  pointer-events: auto;
  transition: opacity 480ms ease;
}

.psky-sky-icon-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}

.psky-sky-icon-button,
.psky-mode-option {
  appearance: none;
  -webkit-appearance: none;
  border: 0;
  background: transparent;
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  cursor: pointer;
}

.psky-sky-icon-button {
  position: relative;
  width: 30px;
  height: 30px;
  padding: 0;
  opacity: 0.34;
}

.psky-sky-icon-button:hover {
  opacity: 0.82;
}

/* hamburger */

.psky-menu-button {
  position: relative;
  z-index: 9991;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  transition: opacity 480ms ease;
}

.psky-menu-line {
  display: block;
  width: 16px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
  transition:
    transform 420ms cubic-bezier(0.16, 1, 0.3, 1),
    opacity 260ms ease;
}

.psky-menu-button.is-open .psky-menu-line:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.psky-menu-button.is-open .psky-menu-line:nth-child(2) {
  opacity: 0;
}

.psky-menu-button.is-open .psky-menu-line:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* fullscreen */

.psky-fullscreen-button {
  display: block;
}

.psky-fullscreen-corner {
  position: absolute;
  width: 5px;
  height: 5px;
  border-color: currentColor;
  border-style: solid;
  border-width: 0;
}

/* normal: expand */
.psky-fullscreen-corner.is-top-right {
  top: 7px;
  right: 7px;
  border-top-width: 1px;
  border-right-width: 1px;
}

.psky-fullscreen-corner.is-bottom-left {
  left: 7px;
  bottom: 7px;
  border-left-width: 1px;
  border-bottom-width: 1px;
}

/* fullscreen: collapse */
.psky-sky-stage.is-fullscreen .psky-fullscreen-corner.is-top-right {
  top: 6px;
  right: 6px;
  border-top-width: 0;
  border-right-width: 0;
  border-left-width: 1px;
  border-bottom-width: 1px;
}

.psky-sky-stage.is-fullscreen .psky-fullscreen-corner.is-bottom-left {
  left: 6px;
  bottom: 6px;
  border-left-width: 0;
  border-bottom-width: 0;
  border-top-width: 1px;
  border-right-width: 1px;
}

/* mode toggle */

.psky-mode-toggle {
  width: 180px;
  height: 30px;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0;
  box-sizing: border-box;
}

.psky-mode-option {
  height: 30px;
  padding: 0 12px;
  border: 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(0, 0, 0, 0.88);
  color: var(--psky-muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  box-sizing: border-box;
  cursor: pointer;
}

.psky-mode-option:first-child {
  border-radius: 0;
}

.psky-mode-option:last-child {
  border-radius: 0;
}

/* state 3: hover */
.psky-mode-option:hover,
.psky-sky-stage.is-finder-mode .is-finder-option:hover,
.psky-sky-stage.is-sky-mode .is-sky-option:hover {
  color: var(--psky-text);
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(0, 0, 0, 0.96);
}

/* state 2: active */
.psky-sky-stage.is-finder-mode .is-finder-option,
.psky-sky-stage.is-sky-mode .is-sky-option {
  color: var(--psky-text);
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.88);
}

/* ============================================================
  Sky bottom actions
============================================================ */

.psky-sky-bottom-actions {
  position: absolute;
  right: 24px;
  bottom: 24px;
  width: 360px;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 8px;
  pointer-events: auto;
}

.psky-sky-bottom-message {
  color: var(--psky-muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  line-height: 1.55;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-align: right;
  white-space: nowrap;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.psky-sky-bottom-message.is-error {
  color: rgba(255, 110, 110, 0.66);
}

.psky-sky-bottom-message[hidden] {
  display: none;
}

.psky-sky-search-row {
  display: grid;
  grid-template-columns: 1fr 72px 72px;
  gap: 8px;
}

.psky-sky-panel-button,
.psky-sky-panel-input {
  height: 30px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.88);
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  box-sizing: border-box;
}

.psky-sky-panel-button {
  padding: 0 12px;
  cursor: pointer;
}

.psky-sky-panel-input {
  width: 100%;
  padding: 0 10px;
  outline: none;
}

.psky-sky-panel-input::placeholder {
  color: var(--psky-muted);
}

/* state 2: primary */
.psky-sky-new-star-button {
  width: 100%;
  color: var(--psky-text);
  border-color: rgba(255, 255, 255, 0.36);
  background: rgba(0, 0, 0, 0.88);
}

/* state 3: hover / focus */
.psky-sky-panel-button:hover,
.psky-sky-panel-input:focus:hover {
  color: var(--psky-text);
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(0, 0, 0, 0.96);
}

/* ============================================================
  Splash overlay
============================================================ */

.psky-splash-overlay {
  position: absolute;
  inset: 0;
  z-index: 50;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 1);
  pointer-events: auto;
  opacity: 1;
  transition: opacity 700ms ease;
}

.psky-splash-overlay.is-fading-out {
  opacity: 0;
  pointer-events: none;
}

.psky-splash-overlay[hidden] {
  display: none;
}

.psky-splash-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 9px;
}

.psky-splash-title {
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  font-size: 18px;
  line-height: 1;
  letter-spacing: 0.25em;
  text-transform: lowercase;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.psky-splash-build {
  color: var(--psky-muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 10px;
  line-height: 1;
  margin-top: 12px;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-shadow: 0 0 10px rgba(0, 0, 0, 0.8);
}

/* ============================================================
  User / debug mode
============================================================ */

body.is-user-mode {
  margin: 0;
  padding: 0;
  width: 100%;
  height: 100%;
  background: #030303;
  overflow: hidden;
}

body.is-user-mode main {
  position: fixed;
  inset: 0;
  width: auto;
  height: auto;
  margin: 0;
  padding: 0;
  background: #030303;
  overflow: hidden;
}

body.is-user-mode .psky-workbench-sidebar {
  display: none;
}

body.is-user-mode .psky-workbench {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: #030303;
  box-sizing: border-box;
  overflow: hidden;
}

body.is-user-mode .psky-workbench-sky {
  position: absolute;
  inset: 0;
  display: block;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

body.is-user-mode .psky-sky-stage {
  position: absolute;
  inset: 0;
  width: auto;
  max-width: none;
  height: auto;
  max-height: none;
  margin: 0;
  padding: 0;
  aspect-ratio: auto;
  border: 0;
}

/* user mode UI inset */

body.is-user-mode .psky-sky-status {
  left: 30px;
  top: 30px;
}

body.is-user-mode .psky-sky-actions {
  right: 30px;
  top: 30px;
}

body.is-user-mode .psky-sky-bottom-actions {
  right: 30px;
  bottom: 30px;
}

body.is-user-mode .psky-sky-star-status {
  left: 30px;
  bottom: 30px;
}

/* ============================================================
  About overlay
============================================================ */

.psky-about-overlay {
  position: absolute;
  inset: 0;
  z-index: 46;
  display: grid;
  place-items: center;
  padding: 24px 0;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  overflow-y: auto;
  box-sizing: border-box;
}

.psky-about-overlay[hidden] {
  display: none;
}

.psky-about-stack {
  width: min(620px, calc(100vw - 72px));
  margin: auto 0;
}

.psky-about-panel {
  width: 100%;
  padding: 28px 32px 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  background: #060606;
  box-sizing: border-box;
  color: var(--psky-text);
  font-family: var(--psky-font-ja);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.psky-about-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
  margin-bottom: 24px;
}

.psky-about-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.psky-about-language-button {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: lowercase;
  cursor: pointer;
}

.psky-about-language-button.is-active {
  color: var(--psky-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.psky-about-language-button:hover {
  color: var(--psky-text);
}

.psky-about-language-separator {
  color: var(--psky-muted);
}

.psky-about-close-button {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-text);
  transform: translateY(-50%);
  cursor: pointer;
}

.psky-about-close-button:hover {
  color: var(--psky-text);
}

.psky-about-close-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.psky-about-close-line.is-a {
  transform: translate(-50%, -50%) rotate(45deg);
}

.psky-about-close-line.is-b {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.psky-about-title {
  margin-bottom: 28px;
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  text-align: center;
}

.psky-about-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--psky-text);
  text-align: center;
}

.psky-about-divider {
  height: 1px;
  margin: 26px 0 18px;
  background: rgba(255, 255, 255, 0.22);
}

.psky-about-notes {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.psky-about-note {
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 11px;
  line-height: 1.75;
  color: var(--psky-muted);
  letter-spacing: 0.04em;
  text-align: left;
}

.psky-about-overlay.is-en .psky-about-body {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

.psky-about-overlay.is-en .psky-about-note {
  letter-spacing: 0.02em;
}


/* ============================================================
  Bookmark overlay
============================================================ */

.psky-bookmark-overlay {
  position: absolute;
  inset: 0;
  z-index: 47;
  display: grid;
  place-items: center;
  padding: 24px 0;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  overflow-y: auto;
  box-sizing: border-box;
}

.psky-bookmark-overlay[hidden] {
  display: none;
}

.psky-bookmark-stack {
  width: min(620px, calc(100vw - 72px));
  margin: auto 0;
}

.psky-bookmark-panel {
  width: 100%;
  padding: 28px 32px 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  background: #060606;
  box-sizing: border-box;
  color: var(--psky-text);
  font-family: var(--psky-font-ja);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.psky-bookmark-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
  margin-bottom: 24px;
}

.psky-bookmark-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.psky-bookmark-language-button {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: lowercase;
  cursor: pointer;
}

.psky-bookmark-language-button.is-active {
  color: var(--psky-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.psky-bookmark-language-button:hover {
  color: var(--psky-text);
}

.psky-bookmark-language-separator {
  color: var(--psky-muted);
}

.psky-bookmark-close-button {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-text);
  transform: translateY(-50%);
  cursor: pointer;
}

.psky-bookmark-close-button:hover {
  color: var(--psky-text);
}

.psky-bookmark-close-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.psky-bookmark-close-line.is-a {
  transform: translate(-50%, -50%) rotate(45deg);
}

.psky-bookmark-close-line.is-b {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.psky-bookmark-body {
  font-size: 16px;
  line-height: 1.85;
  color: var(--psky-text);
  text-align: left;
}

.psky-bookmark-overlay.is-en .psky-bookmark-body {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ============================================================
  Companion app overlay
============================================================ */

.psky-app-overlay {
  position: absolute;
  inset: 0;
  z-index: 49;
  display: grid;
  place-items: center;
  padding: 24px 0;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  overflow-y: auto;
  overflow-x: hidden;
  box-sizing: border-box;
}

.psky-app-overlay[hidden] {
  display: none;
}

.psky-app-stack {
  width: min(520px, calc(100vw - 72px));
  margin: auto 0;
}

.psky-app-panel {
  width: 100%;
  max-width: 100%;
  padding: 28px 32px 30px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  background: #060606;
  box-sizing: border-box;
  color: var(--psky-text);
  font-family: var(--psky-font-ja);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
  overflow-x: hidden;
}

.psky-app-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
  margin-bottom: 26px;
}

.psky-app-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.psky-app-language-button {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: lowercase;
  cursor: pointer;
}

.psky-app-language-button.is-active {
  color: var(--psky-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.psky-app-language-button:hover {
  color: var(--psky-text);
}

.psky-app-language-separator {
  color: var(--psky-muted);
}

.psky-app-close-button {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-text);
  transform: translateY(-50%);
  cursor: pointer;
}

.psky-app-close-button:hover {
  color: var(--psky-text);
}

.psky-app-close-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.psky-app-close-line.is-a {
  transform: translate(-50%, -50%) rotate(45deg);
}

.psky-app-close-line.is-b {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.psky-app-title {
  max-width: 100%;
  margin-bottom: 24px;
  color: var(--psky-text);
  font-family: var(--psky-font-ja);
  font-size: 18px;
  font-weight: 600;
  line-height: 1.85;
  letter-spacing: 0.08em;
  text-align: center;
  overflow-wrap: anywhere;
}

.psky-app-body {
  max-width: 100%;
  font-size: 15px;
  line-height: 1.85;
  color: var(--psky-text);
  text-align: center;
  overflow-wrap: normal;
}

.psky-app-store-area {
  --psky-app-store-asset-width: 164px;
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 34px;
}

.psky-app-name {
  margin-bottom: 13px;
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.16em;
  text-transform: lowercase;
  text-align: center;
}

.psky-app-store-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}

.psky-app-store-link.is-disabled {
  opacity: 0.42;
  cursor: default;
}

.psky-app-store-badge {
  display: block;
  width: min(var(--psky-app-store-asset-width), 100%);
  max-width: 100%;
  height: auto;
}

.psky-app-qr-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-top: 18px;
}

.psky-app-qr-image {
  display: block;
  width: min(var(--psky-app-store-asset-width), 100%);
  max-width: 100%;
  aspect-ratio: 1 / 1;
  height: auto;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: #fff;
}

.psky-app-overlay.is-en .psky-app-title,
.psky-app-overlay.is-en .psky-app-body {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ============================================================
  Support overlay
============================================================ */

.psky-support-overlay {
  position: absolute;
  inset: 0;
  z-index: 49;
  display: grid;
  place-items: center;
  padding: 24px 0;
  background: rgba(0, 0, 0, 0.72);
  pointer-events: auto;
  overflow-y: auto;
  box-sizing: border-box;
}

.psky-support-overlay[hidden] {
  display: none;
}

.psky-support-stack {
  width: min(520px, calc(100vw - 72px));
  margin: auto 0;
}

.psky-support-panel {
  width: 100%;
  padding: 28px 32px 26px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 3px;
  background: #060606;
  box-sizing: border-box;
  color: var(--psky-text);
  font-family: var(--psky-font-ja);
  letter-spacing: 0.06em;
  text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.psky-support-header {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 20px;
  margin-bottom: 24px;
}

.psky-support-language {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-family: "Share Tech Mono", monospace;
  font-size: 11px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.psky-support-language-button {
  appearance: none;
  -webkit-appearance: none;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-muted);
  font: inherit;
  letter-spacing: inherit;
  text-transform: lowercase;
  cursor: pointer;
}

.psky-support-language-button.is-active {
  color: var(--psky-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.psky-support-language-button:hover {
  color: var(--psky-text);
}

.psky-support-language-separator {
  color: var(--psky-muted);
}

.psky-support-close-button {
  position: absolute;
  right: -2px;
  top: 50%;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--psky-text);
  transform: translateY(-50%);
  cursor: pointer;
}

.psky-support-close-button:hover {
  color: var(--psky-text);
}

.psky-support-close-line {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 1px;
  background: currentColor;
  transform-origin: center;
}

.psky-support-close-line.is-a {
  transform: translate(-50%, -50%) rotate(45deg);
}

.psky-support-close-line.is-b {
  transform: translate(-50%, -50%) rotate(-45deg);
}

.psky-support-title {
  margin-bottom: 24px;
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: lowercase;
  text-align: center;
}

.psky-support-body {
  font-size: 15px;
  line-height: 1.85;
  color: var(--psky-text);
  text-align: left;
}

.psky-support-body a {
  color: inherit;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.psky-support-body a:hover {
  color: var(--psky-text);
}

.psky-support-qr-block {
  display: flex;
  justify-content: center;
  margin-top: 22px;
}

.psky-support-qr-image {
  display: block;
  width: 128px;
  height: auto;
}

.psky-support-actions {
  display: flex;
  justify-content: center;
  align-items: center;
  margin-top: 24px;
}

.psky-support-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 12px;
  border: 1px solid rgba(255, 255, 255, 0.36);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.88);
  color: var(--psky-text);
  font-family: "Share Tech Mono", monospace;
  font-size: 13px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-decoration: none;
  cursor: pointer;
  box-sizing: border-box;
  width: 100%;
  max-width: 100%;
}

.psky-support-button:hover {
  color: var(--psky-text);
  border-color: rgba(255, 255, 255, 0.52);
  background: rgba(0, 0, 0, 0.96);
}

.psky-support-button.is-disabled {
  color: var(--psky-muted);
  border-color: rgba(255, 255, 255, 0.18);
  cursor: default;
}


.psky-support-overlay.is-en .psky-support-body {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

/* ============================================================
  Sky mode visibility
============================================================ */

.psky-sky-layer-grid,
.psky-sky-layer-my-constellation-lines,
.psky-sky-layer-my-constellation-stars,
.psky-sky-status,
.psky-sky-star-status,
.psky-sky-bottom-actions {
  transition: opacity 0.8s ease;
}

.psky-sky-stage.is-sky-mode .psky-sky-layer-grid,
.psky-sky-stage.is-sky-mode .psky-sky-layer-my-constellation-lines,
.psky-sky-stage.is-sky-mode .psky-sky-layer-my-constellation-stars,
.psky-sky-stage.is-sky-mode .psky-sky-status,
.psky-sky-stage.is-sky-mode .psky-sky-star-status,
.psky-sky-stage.is-sky-mode .psky-sky-bottom-actions {
  opacity: 0;
  pointer-events: none;
}

.psky-sky-stage.is-sky-mode::before {
  display: none;
}

/* ============================================================
  Shooting star
============================================================ */

.psky-shooting-star {
  position: absolute;
  left: var(--shooting-star-x, 50%);
  top: var(--shooting-star-y, 30%);
  z-index: 80;
  width: var(--shooting-star-length, 220px);
  height: 2px;
  background: rgba(255, 255, 255, 1);
  opacity: 0;
  pointer-events: none;
  transform:
    translate(-50%, -50%)
    rotate(var(--shooting-star-angle, -18deg))
    translateX(0);
  animation: psky-shooting-star 1400ms ease-out forwards;
}

@keyframes psky-shooting-star {
  0% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      rotate(var(--shooting-star-angle, -18deg))
      translateX(0);
  }

  18% {
    opacity: 1;
  }

  100% {
    opacity: 0;
    transform:
      translate(-50%, -50%)
      rotate(var(--shooting-star-angle, -18deg))
      translateX(var(--shooting-star-distance, 260px));
  }
}

.psky-shooting-star-layer {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

.psky-shooting-star-line {
  stroke: rgba(255, 255, 255, 1);
  stroke-width: 1px;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* ============================================================
  Birth highlight
============================================================ */

.psky-birth-highlight {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 96px;
  height: 96px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 50%;
  opacity: 0;
  pointer-events: none;
  transform: translate(-50%, -50%) scale(1);
  animation: psky-birth-highlight 6000ms cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

@keyframes psky-birth-highlight {
  0% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.85);
  }

  12% {
    opacity: 0.46;
  }

  100% {
    opacity: 0;
    transform: translate(-50%, -50%) scale(0.2);
  }
}

/* ============================================================
  Sky menu overlay
============================================================ */

.psky-sky-menu-panel {
  position: fixed;
  inset: 0;
  z-index: 9990;
  display: grid;
  place-items: center;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 24px;
  background: rgba(0, 0, 0, 0.78);
  box-sizing: border-box;
  opacity: 0;
  clip-path: inset(50% 50% 50% 50%);
  pointer-events: none;
  transition:
    opacity 650ms ease,
    clip-path 650ms cubic-bezier(0.16, 1, 0.3, 1);
}

.psky-sky-menu-panel.is-open {
  opacity: 1;
  clip-path: inset(0 0 0 0);
  pointer-events: auto;
}

.psky-sky-menu-panel[hidden] {
  display: none;
}

.psky-sky-menu-panel.is-no-transition,
.psky-sky-menu-panel.is-no-transition .psky-sky-menu-item {
  transition: none;
}

.psky-sky-menu-inner {
  position: relative;
  width: min(420px, calc(100vw - 72px));
  min-height: 280px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
}

.psky-sky-menu-list {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.psky-sky-menu-item {
  display: block;
  width: auto;
  padding: 0;
  border: 0;
  background: transparent;
  color: rgba(255, 255, 255, 0.68);
  font-family: "Share Tech Mono", monospace;
  font-size: 16px;
  line-height: 1;
  letter-spacing: 0.08em;
  text-transform: lowercase;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  cursor: pointer;
  transition:
    opacity 280ms ease,
    color 180ms ease;
  transition-delay: 0ms, 0ms;
}

.psky-sky-menu-panel.is-open .psky-sky-menu-item {
  opacity: 1;
}

.psky-sky-menu-panel.is-open .psky-sky-menu-item:nth-child(1) {
  transition-delay: 0ms, 0ms;
}

.psky-sky-menu-panel.is-open .psky-sky-menu-item:nth-child(2) {
  transition-delay: 90ms, 0ms;
}

.psky-sky-menu-panel.is-open .psky-sky-menu-item:nth-child(3) {
  transition-delay: 180ms, 0ms;
}

.psky-sky-menu-panel.is-open .psky-sky-menu-item:nth-child(4) {
  transition-delay: 270ms, 0ms;
}

.psky-sky-menu-panel.is-open .psky-sky-menu-item:nth-child(5) {
  transition-delay: 360ms, 0ms;
}

.psky-sky-menu-item:hover {
  color: var(--psky-text);
}

.psky-sky-menu-item.is-disabled {
  color: rgba(255, 255, 255, 0.28);
  cursor: default;
  pointer-events: none;
}


@media (prefers-reduced-motion: reduce) {
  .psky-sky-menu-panel,
  .psky-sky-menu-item,
  .psky-menu-line {
    transition: none;
  }

  .psky-sky-menu-panel {
    clip-path: inset(0 0 0 0);
  }
}

/* ============================================================
  Canvas sky engine
============================================================ */

.psky-sky-canvas {
  position: absolute;
  inset: 0;
  z-index: 8;
  width: 100%;
  height: 100%;
  display: block;
  pointer-events: auto;
  cursor: default;
  touch-action: none;
}

.psky-sky-stage.is-sky-mode .psky-sky-canvas {
  z-index: 8;
}

/* ============================================================
  Canvas sky engine v3 layering
============================================================ */

.psky-sky-canvas-base {
  z-index: 7;
  pointer-events: none;
}

.psky-sky-canvas-overlay {
  z-index: 8;
  pointer-events: auto;
}


/* ============================================================
  Mobile tightening: solid UI surfaces
============================================================ */

@media (max-width: 640px) {
  .psky-sky-status,
  body.is-user-mode .psky-sky-status {
    left: max(10px, env(safe-area-inset-left));
    top: max(10px, env(safe-area-inset-top));
  }

  .psky-sky-actions,
  body.is-user-mode .psky-sky-actions {
    right: max(10px, env(safe-area-inset-right));
    top: max(10px, env(safe-area-inset-top));
  }

  .psky-sky-bottom-actions,
  body.is-user-mode .psky-sky-bottom-actions {
    right: max(10px, env(safe-area-inset-right));
    bottom: max(10px, env(safe-area-inset-bottom));
    width: calc(100vw - 20px);
  }

  .psky-sky-search-row {
    grid-template-columns: minmax(0, 1fr) 68px 68px;
    gap: 7px;
  }

  .psky-sky-panel-button {
    padding: 0 8px;
  }

  .psky-sky-star-status,
  body.is-user-mode .psky-sky-star-status {
    left: max(10px, env(safe-area-inset-left));
    right: max(10px, env(safe-area-inset-right));
    bottom: calc(max(10px, env(safe-area-inset-bottom)) + 58px);
    max-width: calc(100vw - 20px);
  }

  .psky-about-overlay,
  .psky-app-overlay,
  .psky-support-overlay {
    background: rgba(0, 0, 0, 0.78);
  }

  /*
  Mobile border contrast boost is intentionally disabled for now.
  It made the mode toggle and finder controls visually heavier on some mobile browsers.

  .psky-mode-option,
  .psky-sky-panel-button,
  .psky-sky-panel-input,
  .psky-support-button {
    border-color: rgba(255, 255, 255, 0.58);
  }

  .psky-sky-stage.is-finder-mode .is-finder-option,
  .psky-sky-stage.is-sky-mode .is-sky-option,
  .psky-sky-stage.is-sky-mode .is-sky-option {
    border-color: rgba(255, 255, 255, 0.72);
  }

  .psky-mode-option:hover,
  .psky-sky-panel-button:hover,
  .psky-sky-panel-input:focus,
  .psky-support-button:hover {
    border-color: rgba(255, 255, 255, 0.86);
  }
  */
}

/* ============================================================
  Public UI size adjustment
  Keep this at the end so it overrides earlier component rules.
============================================================ */

.psky-sky-status-line,
.psky-sky-status-build,
.psky-sky-star-status {
  font-size: 11px;
}

.psky-about-language,
.psky-bookmark-language,
.psky-app-language,
.psky-support-language {
  font-size: 12px;
}

.psky-about-title,
.psky-bookmark-title,
.psky-app-name,
.psky-support-title {
  font-size: 16px;
}

.psky-about-body,
.psky-bookmark-body,
.psky-app-body,
.psky-support-body {
  font-size: 17px;
}

.psky-about-note,
.psky-bookmark-note {
  font-size: 13px;
}

.psky-sky-menu-item {
  font-size: 16px;
}

@media (max-width: 640px) {
    .psky-about-body,
  .psky-bookmark-body,
  .psky-app-body,
  .psky-support-body {
    font-size: 17px;
  }

  .psky-about-note,
  .psky-bookmark-note {
    font-size: 13px;
    line-height: 1.85;
  }

  .psky-sky-menu-inner {
    width: min(360px, calc(100vw - 48px));
  }

  .psky-sky-menu-item {
    font-size: 16px;
  }
}

/* ============================================================
   public UI size adjustment
============================================================ */
.psky-button,
.psky-sky-panel-button,
.psky-about-language-button,
.psky-bookmark-language-button,
.psky-support-language-button,
.psky-support-button {
  font-size: 13px;
}

@media (max-width: 720px) {
  .psky-button,
  .psky-sky-panel-button,
  .psky-about-language-button,
  .psky-bookmark-language-button,
  .psky-support-language-button,
  .psky-support-button {
    font-size: 14px;
  }
}


/* ============================================================
   public UI text refinement
   - bottom search / clear buttons: 1px smaller
   - top mode toggle: match bottom button size
============================================================ */
.psky-mode-option,
.psky-sky-panel-button {
  font-size: 12px;
}

@media (max-width: 720px) {
  .psky-mode-option,
  .psky-sky-panel-button {
    font-size: 13px;
  }
}

/* ============================================================
  About text final layout
============================================================ */

.psky-about-body {
  text-align: left;
}

.psky-about-body p {
  margin: 0 0 1.35em;
  color: var(--psky-text);
}

.psky-about-body p:last-child {
  margin-bottom: 0;
}

.psky-about-notes {
  gap: 13px;
}


/* ============================================================
  About body explicit size fix
  The body text is rendered as paragraphs, so target both wrapper and p.
============================================================ */

.psky-about-body,
.psky-about-body p {
  font-size: 17px;
}

@media (max-width: 640px) {
  .psky-about-body,
  .psky-about-body p {
    font-size: 17px;
  }
}

/* ============================================================
  Full-screen reading overlays on smartphone
============================================================ */

@media (max-width: 640px) {
  .psky-about-overlay,
  .psky-support-overlay {
    padding: 0;
    background: #060606;
    place-items: start center;
  }

  .psky-about-stack,
  .psky-support-stack {
    width: 100%;
    min-height: 100vh;
    min-height: 100dvh;
    margin: 0;
  }

  .psky-about-panel,
  .psky-support-panel {
    min-height: 100vh;
    min-height: 100dvh;
    border: 0;
    border-radius: 0;
    padding:
      max(34px, calc(env(safe-area-inset-top) + 22px))
      24px
      max(30px, calc(env(safe-area-inset-bottom) + 22px));
  }
}

@media (max-width: 640px) {
  .psky-app-overlay {
    padding: 24px 0;
    background: rgba(0, 0, 0, 0.72);
    place-items: center;
  }

  .psky-app-stack {
    width: min(520px, calc(100vw - 32px));
    min-height: 0;
    margin: auto 0;
  }

  .psky-app-panel {
    min-height: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 3px;
    padding: 26px 22px 28px;
  }

  .psky-app-title {
    font-size: 16px;
    line-height: 1.75;
    overflow-wrap: normal;
  }

  .psky-app-body {
    font-size: 14px;
    line-height: 1.8;
    overflow-wrap: normal;
  }

  .psky-app-store-area {
    --psky-app-store-asset-width: 156px;
    margin-top: 30px;
  }

  .psky-app-qr-block {
    display: flex;
  }
}

body.is-touch-fullscreen-disabled .psky-fullscreen-button {
  display: none;
}

/* ============================================================
  Help / feedback overlay sections
============================================================ */

.psky-overlay-section-title {
  margin: 1.65em 0 0.35em;
  color: var(--psky-text);
  font-size: 17px;
  line-height: 1.85;
  text-align: left;
}

.psky-overlay-section-title:first-child {
  margin-top: 0;
}

.psky-help-body a,
.psky-about-body a {
  color: var(--psky-text);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
}

.psky-help-body a:hover,
.psky-about-body a:hover {
  color: var(--psky-muted);
}

@media (max-width: 640px) {
  .psky-overlay-section-title {
    font-size: 17px;
  }
}

/* ============================================================
  Support thanks page
============================================================ */

body.is-support-thanks-view {
  background: #060606;
}

body.is-support-thanks-view main {
  display: none;
}

.psky-support-thanks-page {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: #060606;
}

.psky-support-thanks-page .psky-app-panel {
  border: 0;
  background: transparent;
}

.psky-support-thanks-page .psky-app-title {
  font-family: "Share Tech Mono", monospace;
  font-size: 15px;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: lowercase;
}

.psky-support-thanks-form[hidden],
.psky-support-thanks-complete[hidden] {
  display: none;
}

.psky-support-thanks-form {
  display: flex;
  flex-direction: column;
  gap: 14px;
  margin-top: 32px;
  color: var(--psky-text);
  font-family: var(--psky-font-ja);
  letter-spacing: 0.06em;
  text-align: left;
}

.psky-support-thanks-field {
  display: flex;
  flex-direction: column;
  gap: 8px;
  min-width: 0;
  color: var(--psky-text);
  font-size: 12px;
  line-height: 1;
  letter-spacing: 0.08em;
}

.psky-support-thanks-textarea,
.psky-support-thanks-input {
  width: 100%;
  max-width: 100%;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 3px;
  background: rgba(0, 0, 0, 0.62);
  color: var(--psky-text);
  font: inherit;
  font-size: 14px;
  line-height: 1.6;
  letter-spacing: 0.04em;
  box-sizing: border-box;
  outline: none;
}

.psky-support-thanks-textarea {
  min-height: 116px;
  padding: 10px 11px;
  resize: vertical;
}

.psky-support-thanks-input {
  height: 36px;
  padding: 0 10px;
}

.psky-support-thanks-textarea:focus,
.psky-support-thanks-input:focus {
  border-color: rgba(255, 255, 255, 0.52);
}

.psky-support-thanks-field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 12px;
}

.psky-support-thanks-honeypot {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.psky-support-thanks-turnstile {
  display: flex;
  justify-content: center;
  min-height: 65px;
  margin-top: 2px;
}

.psky-support-thanks-status {
  min-height: 1.5em;
  color: var(--psky-muted);
  font-family: "Share Tech Mono", monospace;
  font-size: 12px;
  line-height: 1.5;
  letter-spacing: 0.04em;
  text-align: center;
  text-transform: lowercase;
}

.psky-support-thanks-status.is-error {
  color: var(--psky-text);
}

.psky-support-thanks-submit {
  margin-top: 0;
}

.psky-support-thanks-complete {
  margin-top: 30px;
}

.psky-support-thanks-page.is-en .psky-support-thanks-form,
.psky-support-thanks-page.is-en .psky-support-thanks-field {
  font-family: "Share Tech Mono", monospace;
  letter-spacing: 0.04em;
  text-transform: lowercase;
}

@media (max-width: 640px) {
  .psky-support-thanks-field-row {
    grid-template-columns: 1fr;
  }

  .psky-support-thanks-form {
    margin-top: 28px;
  }

  .psky-support-thanks-textarea,
  .psky-support-thanks-input {
    font-size: 14px;
  }
}
