:root {
  /* サイト固有 */
  --bg: #fff;
  --line-2: #2b2b2b;
  --text: #101010;
  --muted: #585858;
  --footer-h: 40px;
  --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Hiragino Kaku Gothic ProN", "Noto Sans JP", "Yu Gothic", sans-serif;

  /* ---- ボタン共通トークン（_halftone-tokens.scss と同値を維持） ---- */
  --btn-radius:      9999px;
  --btn-fw:          600;
  --btn-fs:          0.875rem;
  --btn-border-w:    1.5px;
  --btn-transition:  background .15s ease, color .15s ease, border-color .15s ease;

  --btn-header-py:   0.44rem;
  --btn-header-px:   1rem;
  --btn-header-fs:   0.8rem;

  --btn-panel-py:    0.65rem;
  --btn-panel-px:    1.25rem;

  --btn-primary-bg:       #0761d1;
  --btn-primary-fg:       #fff;
  --btn-primary-hover-bg: #0550b3;

  --btn-ghost-light-fg:     #111;
  --btn-ghost-light-border: rgba(0, 0, 0, 0.2);
  --btn-ghost-light-hover:  rgba(0, 0, 0, 0.05);

  --btn-ghost-dark-fg:     rgba(255, 255, 255, 0.9);
  --btn-ghost-dark-border: rgba(255, 255, 255, 0.25);
  --btn-ghost-dark-hover:  rgba(255, 255, 255, 0.08);

  --btn-secondary-bg: #111;
  --btn-secondary-fg: #fff;
}

* {
  box-sizing: border-box
}

html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font)
}

a {
  color: inherit;
  text-decoration: none
}

/* 縦フル高：ヘッダー固定高さにせず、メインが残りを埋める */
.site-shell {
  min-height: calc(100vh - 14px);
  min-height: calc(100dvh - 14px);
  display: flex;
  flex-direction: column;
  background: #fff;
  overflow-x: hidden;
  border-radius: 0;
  width: 100%;
  max-width: calc(100% - 14px);
  margin: 7px auto;
  border: 0;
}

.site-header {
  flex: 0 0 auto;
  padding: 0;
  border-bottom: 0;
  background: #fff;
  border-radius: 0;
}

.site-header__inner {
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 62px;
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  justify-content: space-between;
  gap: 16px 24px;
  min-width: 0;
}

.site-header__inner .brand {
  flex: 0 0 auto
}

.site-header__left {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.site-header__inner .site-nav {
  flex: 1 1 auto;
  display: flex;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 24px 42px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: .06em;
  min-width: 0;
}

.site-header__inner .site-actions {
  flex: 0 0 auto
}

.brand.halftone-brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.halftone-brand__logo {
  height: 32px;
  width: auto;
  max-width: min(200px, 40vw);
  display: block;
  object-fit: contain;
}

.site-nav a {
  opacity: .85
}

.site-nav a:hover {
  opacity: 1
}

.site-actions {
  display: flex;
  align-items: center;
  gap: 14px
}

.ft-header-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: var(--btn-header-py) var(--btn-header-px);
  font-size: var(--btn-header-fs);
  font-weight: var(--btn-fw);
  border-radius: var(--btn-radius);
  text-decoration: none;
  border: var(--btn-border-w) solid transparent;
  white-space: nowrap;
  transition: var(--btn-transition);
  line-height: 1;
}

.ft-header-btn--ghost {
  color: var(--btn-ghost-light-fg);
  border-color: var(--btn-ghost-light-border);
  background: transparent;
}

.ft-header-btn--ghost:hover {
  background: var(--btn-ghost-light-hover);
}

.ft-header-btn--primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-fg) !important;
  border-color: var(--btn-primary-bg);
}

.ft-header-btn--primary:hover {
  background: var(--btn-primary-hover-bg);
  border-color: var(--btn-primary-hover-bg);
}

.ft-header-btn--secondary {
  background: var(--btn-secondary-bg);
  color: var(--btn-secondary-fg) !important;
  border-color: var(--btn-secondary-bg);
}

.ft-header-btn--secondary:hover {
  opacity: 0.82;
}

.is-authenticated .ft-header-signup-btn {
  display: none;
}

.ft-menu-toggle {
  display: none !important;
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer
}

.navicon {
  position: relative;
  display: block;
  width: 18px;
  height: 2px;
  background: #111;
  border-radius: 1px;
}

.navicon:before,
.navicon:after {
  content: "";
  position: absolute;
  left: 0;
  width: 18px;
  height: 2px;
  background: #111;
  border-radius: 1px;
}

.navicon:before {
  top: -6px
}

.navicon:after {
  top: 6px
}

.ft-mobile-menu {
  display: none !important
}

.ft-mobile-overlay {
  display: none !important
}

.sub-link {
  font-size: 12px;
  font-weight: 600;
  opacity: .72;
  white-space: nowrap
}

.sub-link:hover {
  opacity: 1
}

.login-icon-btn {
  position: relative;
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: #101010;
  text-decoration: none;
}

.login-icon-btn svg {
  width: 16px;
  height: 16px;
  fill: currentColor
}

.login-icon-btn:hover {
  background: #111;
  color: #f4f4f2
}

.site-shell.is-authenticated .login-icon-btn {
  background: #0a8a60;
  border-color: #0a8a60;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(10, 138, 96, .2);
}

.site-shell.is-authenticated .login-icon-btn::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #34d399;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(10, 138, 96, .45);
}

.site-shell.is-authenticated .login-icon-btn:hover {
  background: #087a54;
  color: #fff;
}

/* 契約済み: ft-halftone-user-nav が .login-icon-btn--account を付与。親 .is-authenticated だけに依存しない */
.login-icon-btn.login-icon-btn--account {
  background: #0a8a60;
  border-color: #0a8a60;
  color: #fff;
  box-shadow: 0 0 0 3px rgba(10, 138, 96, .2);
}

.login-icon-btn.login-icon-btn--account::after {
  content: "";
  position: absolute;
  top: -1px;
  right: -1px;
  width: 9px;
  height: 9px;
  border-radius: 999px;
  background: #34d399;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(10, 138, 96, .45);
}

.login-icon-btn.login-icon-btn--account:hover {
  background: #087a54;
  color: #fff;
}

/* 言語 UI はサイト共通 assets/css/ft-i18n-lang.css（.ft-lang-switch）に統一 */
.sign-btn {
  display: inline-flex;
  align-items: center;
  height: 40px;
  padding: 0 18px;
  border-radius: 12px;
  border: 1px solid var(--line-2);
  background: #fff;
  color: #101010;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none
}

.sign-btn--launch {
  background: #111;
  color: #f4f4f2
}

/* 枠・角丸をやめてダークエリアを横いっぱいに */
.app-stage {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  padding: 0;
  background: #120d07;
}

#appFrame {
  flex: 1 1 auto;
  width: 100%;
  min-height: 0;
  border: 0;
  border-radius: 0;
  display: block;
  background: #120d07;
}

.site-footer {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1680px;
  margin: 0 auto;
  padding: 12px 62px;
  width: 100%;
  box-sizing: border-box;
  color: var(--muted);
  font-size: 11px;
  border-top: 0;
  background: #fff;
  border-radius: 0;
}

.site-footer__legal {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0;
}

.site-footer__legal a {
  text-decoration: underline;
  text-underline-offset: 2px;
}

.site-footer__legal a:hover {
  color: var(--text);
}

.site-footer__sep {
  user-select: none;
}

/* B: 段階ブレイクポイント
   <=1100px: ヘッダーを圧縮（文字間隔など）
   <=600px: ハンバーガーメニューへ切替 */

@media (max-width:600px) {
  .site-shell {
    max-width: 100%;
    margin: 0;
    border-radius: 0;
    border: 0;
  }

  .site-header__inner {
    flex-wrap: nowrap;
    padding: 14px 20px;
  }

  .site-header__inner .brand:not(.halftone-brand) {
    font-size: 24px
  }

  .site-header__inner .site-nav {
    display: none
  }

  .sub-link {
    font-size: 11px
  }

  .site-header__inner .site-actions {
    display: inline-flex;
    margin-left: 0;
    gap: 8px;
  }

  .site-header__inner .site-actions .sub-link,
  .site-header__inner .site-actions .login-icon-btn {
    display: none;
  }

  .site-header__inner .site-actions .ft-lang-switch__select {
    min-width: 84px;
    font-size: 12px;
    padding: 3px 22px 3px 8px;
  }

  .ft-header-btn {
    display: none;
  }

  .ft-menu-toggle {
    display: inline-flex !important;
    margin-left: auto;
    align-items: center;
    justify-content: center;
    z-index: 1002;
  }

  .ft-mobile-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, .55);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity .25s ease-out;
    z-index: 1000;
  }

  .ft-mobile-menu {
    position: fixed;
    top: 0;
    bottom: 0;
    right: 0;
    left: auto;
    width: min(300px, 86vw);
    height: 100%;
    max-height: none;
    background: #151515;
    color: #fff;
    border-radius: 20px 0 0 20px;
    padding: 72px 24px 40px;
    display: flex !important;
    flex-direction: column;
    gap: 0;
    transform: translateX(110%);
    opacity: 1 !important;
    pointer-events: none;
    transition: transform 0.30s cubic-bezier(0.32, 0.72, 0, 1);
    z-index: 1001;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
  }

  .ft-mobile-menu a {
    display: block;
    font-size: 15px;
    font-weight: 700;
    letter-spacing: .04em;
    padding: 13px 0;
    border-bottom: 1px solid rgba(255, 255, 255, .07);
    color: rgba(255, 255, 255, .92);
    text-decoration: none;
    transition: color .15s ease, padding-left .15s ease;
  }

  .ft-mobile-menu a:last-child {
    border-bottom: none;
  }

  .ft-panel-auth-btns {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 24px;
    padding-top: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.07);
  }

  .ft-panel-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    padding: var(--btn-panel-py) var(--btn-panel-px);
    font-size: var(--btn-fs);
    font-weight: var(--btn-fw);
    border-radius: var(--btn-radius);
    text-decoration: none;
    border: var(--btn-border-w) solid transparent;
    text-align: center;
    transition: var(--btn-transition);
    box-sizing: border-box;
  }

  .ft-panel-btn--ghost {
    background: transparent;
    color: var(--btn-ghost-dark-fg);
    border-color: var(--btn-ghost-dark-border);
  }

  .ft-panel-btn--ghost:hover {
    background: var(--btn-ghost-dark-hover);
    color: #fff;
  }

  .ft-panel-btn--primary {
    background: var(--btn-primary-bg);
    color: var(--btn-primary-fg) !important;
    border-color: var(--btn-primary-bg);
  }

  .ft-panel-btn--primary:hover {
    background: var(--btn-primary-hover-bg);
    border-color: var(--btn-primary-hover-bg);
  }

  .ft-panel-btn--secondary {
    background: #fff;
    color: #111 !important;
    border-color: #fff;
  }

  .ft-panel-btn--secondary:hover {
    opacity: 0.88;
  }

  .is-authenticated .ft-header-signup-btn {
    display: none;
  }

  .ft-mobile-menu a:hover {
    color: #fff;
    padding-left: 4px;
  }

  .ft-mobile-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .16);
    border-radius: 50%;
    background: rgba(255, 255, 255, .10);
    cursor: pointer;
    padding: 0;
  }

  .ft-mobile-close span {
    position: absolute;
    width: 16px;
    height: 2px;
    background: rgba(255, 255, 255, .9);
    transform-origin: center;
  }

  .ft-mobile-close span:first-child {
    transform: rotate(45deg);
  }

  .ft-mobile-close span:last-child {
    transform: rotate(-45deg);
  }

  body.ft-mobile-open {
    overflow: hidden;
  }

  body.ft-mobile-open .ft-menu-toggle {
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.15s ease;
  }

  body.ft-mobile-open .ft-mobile-overlay {
    opacity: 1;
    pointer-events: auto;
  }

  body.ft-mobile-open .ft-mobile-menu {
    transform: translateX(0);
    pointer-events: auto;
  }

  .site-footer {
    padding: 12px 20px
  }

  /* Main content: keep mobile switch aligned with <=600px. */
  .app-stage {
    padding: 0;
  }

  #appFrame {
    border-radius: 0;
  }
}

@media (max-width:1100px) {
  .site-header__inner {
    padding: 12px 20px;
    gap: 10px 16px;
  }

  .site-header__inner .site-nav {
    gap: 14px 18px;
    font-size: 13px;
  }

  .site-actions {
    gap: 8px;
  }

  .sub-link {
    font-size: 11px;
  }
}

/*
 * Fix: Make the header logo clickable
 * -------------------------------------------------- */
.halftone-brand {
  display: block;
  /* <a>タグが適切な領域を持つように念のため指定 */
  cursor: pointer;
  position: relative;
  /* z-indexを有効にするために必要 */
  z-index: 1;
  /* ヘッダー内の他の要素より手前に来るように */
}