:root {
  --shell-ink: #11110f;
  --shell-paper: #fbfaf7;
  --shell-white: #fff;
  --shell-gold: #bea064;
  --shell-gold-light: #d8c392;
  --shell-teal: #24575b;
  --shell-teal-deep: #12383c;
  --shell-line: #ded7c8;
  --shell-muted: #666159;
  --shell-serif: Georgia, "Times New Roman", "Yu Mincho", "Hiragino Mincho ProN", serif;
  --shell-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "Hiragino Sans", "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
}

[data-site-header] { display: block; min-height: 76px; background: var(--shell-paper); }
[data-site-footer] { display: block; min-height: 112px; background: var(--shell-paper); }

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) auto minmax(132px, 1fr);
  align-items: center;
  min-height: 76px;
  padding: 0 clamp(24px, 5vw, 72px);
  color: var(--shell-ink);
  background: rgba(251, 250, 247, 0.97);
  border-bottom: 1px solid var(--shell-line);
  backdrop-filter: blur(12px);
  font-family: var(--shell-sans);
}
.site-header .brand,
.footer .brand { display: inline-flex; align-items: center; justify-self: start; }
.site-header .brand-logo { display: block; width: clamp(180px, 17vw, 248px); height: 48px; object-fit: contain; object-position: left center; }
.site-header .global-nav { display: flex; align-items: stretch; gap: clamp(12px, 1.6vw, 28px); font-size: clamp(0.76rem, 0.82vw, 0.86rem); font-weight: 700; }
.site-header .global-nav a {
  display: flex;
  align-items: center;
  min-height: 76px;
  padding: 2px 0 0;
  color: var(--shell-ink);
  border-bottom: 2px solid transparent;
  text-decoration: none;
  white-space: nowrap;
  transition: color 0.22s, border-color 0.22s;
}
.site-header .global-nav a:hover,
.site-header .global-nav a[aria-current="page"] { color: var(--shell-teal); border-color: var(--shell-gold); }
.site-header .header-contact {
  justify-self: end;
  padding: 12px 24px;
  color: var(--shell-teal);
  font-family: var(--shell-serif);
  font-size: 0.84rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  border: 1px solid rgba(36, 87, 91, 0.55);
  text-decoration: none;
  transition: color 0.22s, background 0.22s, border-color 0.22s;
}
.site-header .header-contact:hover { color: var(--shell-white); background: var(--shell-teal); border-color: var(--shell-teal); }
.nav-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 11px;
  border: 1px solid rgba(36, 87, 91, 0.3);
  background: transparent;
  cursor: pointer;
}
.nav-toggle span { display: block; height: 1px; margin: 5px 0; background: var(--shell-teal-deep); transition: transform 0.22s, opacity 0.22s; }

.footer {
  display: grid;
  grid-template-columns: minmax(210px, 0.8fr) minmax(0, 1.8fr) auto;
  align-items: center;
  gap: 30px;
  padding: 34px clamp(24px, 6vw, 88px);
  color: var(--shell-ink);
  background: var(--shell-paper);
  border-top: 1px solid var(--shell-line);
  font-family: var(--shell-sans);
}
.footer .brand-logo { display: block; width: 220px; height: 44px; object-fit: contain; object-position: left center; }
.footer-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 13px 24px; color: var(--shell-muted); font-size: 0.86rem; }
.footer-nav a { color: inherit; text-decoration: none; }
.footer-nav a:hover { color: var(--shell-teal); }
.footer > small { color: var(--shell-muted); font-size: 0.76rem; white-space: nowrap; }

.page-context-bar {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 20px;
  min-height: 46px;
  padding: 8px clamp(20px, 5vw, 72px);
  color: #dbe5e2;
  background: var(--shell-teal-deep);
  border-bottom: 1px solid rgba(216, 195, 146, 0.25);
  font-family: var(--shell-sans);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.13em;
}
.page-context-bar > span:first-child { margin-right: auto; color: var(--shell-gold-light); }
.page-context-bar .member-header-actions { display: flex; align-items: center; gap: 16px; }
.page-context-bar .member-header-actions span { color: #dbe5e2; letter-spacing: 0.04em; }
.page-context-bar .header-logout {
  border: 1px solid rgba(255,255,255,0.45);
  background: transparent;
  color: var(--shell-white);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 0.74rem;
}
.page-context-bar .header-logout:hover { background: rgba(255,255,255,0.1); }

@media (max-width: 1180px) {
  .site-header { grid-template-columns: minmax(190px, 1fr) auto minmax(118px, 1fr); padding-right: 24px; padding-left: 24px; }
  .site-header .brand-logo { width: 190px; }
  .site-header .global-nav { gap: 14px; font-size: 0.74rem; }
  .site-header .header-contact { padding-right: 16px; padding-left: 16px; }
}

@media (max-width: 1020px) {
  [data-site-header] { min-height: 66px; }
  .site-header {
    grid-template-columns: minmax(150px, 1fr) auto auto;
    min-height: 66px;
    padding: 0 18px;
  }
  .site-header .brand-logo { width: 164px; height: 40px; }
  .nav-toggle { display: block; justify-self: end; margin-right: 8px; }
  .site-header .global-nav {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100vh - 66px);
    overflow-y: auto;
    padding: 12px 20px 20px;
    background: rgba(251, 250, 247, 0.99);
    border-top: 1px solid var(--shell-line);
    border-bottom: 1px solid var(--shell-line);
    box-shadow: 0 18px 36px rgba(18, 56, 60, 0.13);
  }
  .site-header.is-menu-open .global-nav { display: grid; }
  .site-header .global-nav a {
    min-height: 48px;
    padding: 0 4px;
    border-bottom: 1px solid var(--shell-line);
    font-size: 0.94rem;
  }
  .site-header .global-nav a:last-child { border-bottom: 0; }
  .site-header.is-menu-open .nav-toggle span:nth-child(1) { transform: translateY(6px) rotate(45deg); }
  .site-header.is-menu-open .nav-toggle span:nth-child(2) { opacity: 0; }
  .site-header.is-menu-open .nav-toggle span:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }
  .site-header .header-contact { padding: 9px 12px; font-size: 0.68rem; }
  .footer { grid-template-columns: 1fr; justify-items: start; }
  .footer-nav { justify-content: flex-start; }
}

@media (max-width: 560px) {
  .site-header { grid-template-columns: minmax(118px, 1fr) auto auto; padding: 0 12px; }
  .site-header .brand-logo { width: 142px; }
  .nav-toggle { width: 40px; height: 40px; margin-right: 4px; padding: 9px; }
  .site-header .header-contact { padding: 8px 9px; font-size: 0.62rem; }
  .footer { padding: 30px 20px; }
  .footer .brand-logo { width: 190px; }
  .footer-nav { align-items: flex-start; flex-direction: column; gap: 10px; }
  .page-context-bar { align-items: flex-start; flex-direction: column; gap: 8px; padding: 12px 20px; }
  .page-context-bar .member-header-actions { width: 100%; justify-content: space-between; }
}
