/* ASI Studio - 受託開発スタジオ + クライアントポータル */

:root {
  --bg: #ffffff;
  --bg-2: #f7f8fa;
  --surface: #ffffff;
  --surface-2: #f3f5f8;
  --line: #e5e8ee;
  --line-strong: #d6dbe3;
  --text: #1a1f2e;
  --text-muted: #6b7280;
  --primary: #ff5a36;
  --primary-2: #ff7d5e;
  --primary-soft: #fff0eb;
  --accent: #2563eb;
  --accent-soft: #eef4ff;
  --success: #16a34a;
  --success-soft: #e8f7ee;
  --warn: #d97706;
  --warn-soft: #fef3e2;
  --danger: #dc2626;
  --danger-soft: #fdecec;
  --radius: 10px;
  --radius-lg: 16px;
  --shadow: 0 2px 10px rgba(20, 30, 60, 0.04);
  --shadow-lg: 0 8px 24px rgba(20, 30, 60, 0.07);
  --container: 1120px;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 64px;
}

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg-2);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Hiragino Sans", "Yu Gothic UI", system-ui, sans-serif;
  font-feature-settings: "palt";
  -webkit-font-smoothing: antialiased;
  line-height: 1.7;
  overflow-x: clip;
}
body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
.site-main { flex: 1; }
body.is-portal .site-main { padding-bottom: 60px; }

/* 必須未入力フィールドのハイライト（dashboard→profile?highlight=missing 遷移時） */
.is-required-missing {
  border-color: var(--danger) !important;
  background: var(--danger-soft);
  box-shadow: 0 0 0 1px var(--danger);
}
.is-required-missing:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(220, 53, 69, 0.18);
}

/* ── 全ページ共通背景（ドットグリッド） ── */
body.is-portal {
  background-color: #fafbfc;
  background-image: radial-gradient(circle, rgba(0,0,0,0.05) 1px, transparent 1px);
  background-size: 18px 18px;
}

a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--primary); }
img { max-width: 100%; display: block; }

.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}
@media (max-width: 880px) {
  .container { padding: 0 12px; }
}

.muted { color: var(--text-muted); }
.small { font-size: 0.875rem; }
.center { text-align: center; }
.mt-1 { margin-top: 0.5rem; } .mt-2 { margin-top: 1rem; } .mt-3 { margin-top: 1.5rem; } .mt-4 { margin-top: 2rem; } .mt-6 { margin-top: 3rem; }
.mb-1 { margin-bottom: 0.5rem; } .mb-2 { margin-bottom: 1rem; } .mb-3 { margin-bottom: 1.5rem; } .mb-4 { margin-bottom: 2rem; }

/* === Header === */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: saturate(160%) blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}
.brand:hover { color: var(--text); }
.brand__mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 8px;
  background: linear-gradient(135deg, var(--primary), var(--primary-2));
  color: #fff;
  font-weight: 800;
}
.site-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  position: fixed;
  top: 0;
  right: max(0px, calc((100vw - var(--container)) / 2));
  height: 64px;
  padding: 0 24px;
  z-index: 60;
}
.site-nav__sub-links { display: none; }
.nav-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 999px;
  background: var(--primary-soft);
  color: var(--primary);
  font-size: 0.62rem;
  font-weight: 700;
  line-height: 1;
}
.site-nav__icon-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.site-nav__icon-wrap .nav-badge {
  position: absolute;
  top: -6px;
  right: -8px;
  margin: 0;
}
.site-nav__link-with-badge { display: inline-flex; align-items: center; }
.site-nav a {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  color: var(--text);
  font-size: 0.68rem;
  opacity: 0.78;
  line-height: 1;
}
.site-nav a svg { width: 16px; height: 16px; flex-shrink: 0; }
.site-nav__label { margin-top: 1px; display: inline-flex; align-items: center; gap: 2px; }
.site-nav a:hover { opacity: 1; color: var(--text); }
.site-nav a.btn { flex-direction: row; font-size: 0.85rem; gap: 6px; }
.site-nav__avatar {
  width: 22px;
  height: 22px;
  border-radius: 4px;
  object-fit: contain;
  flex-shrink: 0;
  border: 1px solid var(--line);
  background: #fff;
  padding: 2px;
}

/* SP-only要素：PCでは非表示 */
.sp-user-header { display: none; }
.sp-user-links { display: none; }

/* ユーザーメニュー */
.user-menu { position: relative; }
.user-menu__trigger {
  display: inline-flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
  background: none;
  border: 1px solid var(--line);
  cursor: pointer;
  padding: 0 8px;
  height: 32px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.8rem;
  opacity: 0.85;
  line-height: 1;
}
.user-menu__trigger:hover { opacity: 1; background: var(--surface-2); }
.user-menu__avatar-fallback svg { width: 20px; height: 20px; color: var(--text-muted); }
.user-menu__name { margin-top: 0; }
.user-menu__chevron { width: 12px !important; height: 12px !important; flex-shrink: 0; opacity: 0.6; transition: transform 0.15s; }
.user-menu:hover .user-menu__chevron { transform: rotate(180deg); }
.user-menu__dropdown {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 20px);
  right: 0;
  min-width: 200px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 200;
  transition: opacity 0.15s, visibility 0.15s;
}
/* トリガーとドロップダウンの隙間を埋めるブリッジ */
.user-menu__dropdown::before {
  content: '';
  position: absolute;
  top: -20px;
  left: -10px;
  right: -10px;
  height: 20px;
}
.user-menu:hover .user-menu__dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
.user-menu__item {
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
}
/* .site-nav a の inline-flex/column/opacity/font-size を上書き */
.user-menu__dropdown .user-menu__item {
  display: flex;
  flex-direction: row;
  opacity: 1;
  font-size: 0.85rem;
  width: 100%;
}
.user-menu__item svg { width: 15px; height: 15px; flex-shrink: 0; color: var(--text-muted); }
.user-menu__item:hover { background: var(--surface-2); }
.user-menu__item--logout { color: var(--danger, #e53e3e); }
.user-menu__divider { border-top: 1px solid var(--line); margin: 4px 0; }

/* === Nav item dropdowns (PC only, hover) === */
.nav-item-with-drop { position: relative; }
.nav-drop-chevron {
  width: 10px !important;
  height: 10px !important;
  flex-shrink: 0;
  opacity: 0.6;
  transition: transform 0.15s;
}
.nav-item-with-drop:hover .nav-drop-chevron { transform: rotate(180deg); }
.nav-dropdown {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  position: absolute;
  top: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%);
  min-width: 170px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 24px rgba(0,0,0,.12);
  padding: 6px;
  z-index: 200;
  transition: opacity 0.15s, visibility 0.15s;
  white-space: nowrap;
}
.nav-dropdown::before {
  content: '';
  position: absolute;
  top: -8px;
  left: 0;
  right: 0;
  height: 8px;
}
.nav-item-with-drop:hover .nav-dropdown {
  visibility: visible;
  opacity: 1;
  pointer-events: auto;
}
/* .site-nav a の inline-flex/column/opacity/font-size を上書き */
.nav-dropdown .nav-dropdown__item {
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 8px;
  padding: 9px 12px;
  border-radius: 7px;
  font-size: 0.85rem;
  font-weight: 400;
  letter-spacing: 0;
  color: var(--text);
  text-decoration: none;
  transition: background 0.1s;
  width: 100%;
  opacity: 1;
}
.nav-dropdown .nav-dropdown__item svg { width: 14px; height: 14px; flex-shrink: 0; color: var(--text-muted); }
.nav-dropdown .nav-dropdown__item:hover { background: var(--surface-2); color: var(--text); }
.nav-dropdown__sep { border-top: 1px solid var(--line); margin: 4px 0; }
.nav-dropdown--minutes { min-width: 220px; }
.nav-dropdown--requests { min-width: 360px; }
.nav-dropdown__item--recent span { max-width: 190px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; display: block; }

/* === Mobile nav (hamburger + drawer) === */
.nav-toggle {
  display: none;
  flex-direction: column;
  align-items: center;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  cursor: pointer;
  color: var(--text);
  gap: 1px;
}
.nav-toggle svg { width: 22px; height: 22px; }
.nav-toggle__label { display: block; font-size: 0.55rem; letter-spacing: 0.08em; color: var(--text-muted); margin-top: 1px; }
.nav-toggle__close { display: none; font-size: 0.55rem; letter-spacing: 0.06em; color: var(--text-muted); margin-top: 1px; }
body.nav-open .nav-toggle__label { display: none; }
body.nav-open .nav-toggle__close { display: block; }
body.nav-open .nav-toggle .lucide-menu { display: none; }
body.nav-open .nav-toggle .lucide-x { display: block; }
.nav-toggle .lucide-x { display: none; }
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  z-index: 1000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}
body.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }

@media (max-width: 880px) {
  .nav-toggle { display: inline-flex; flex-direction: column; align-items: center; justify-content: center; }
  body.nav-open .site-header { z-index: 1020; }
  body.nav-open .nav-toggle { position: relative; z-index: 1030; }
  body.nav-open .nav-overlay { display: none; }
  .site-nav {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    height: 100vh;
    width: 100%;
    background: #fff;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 80px 24px 24px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.14);
    z-index: 1010;
    overflow-y: auto;
  }
  body.nav-open .site-nav {
    display: flex;
    animation: sp-nav-in 0.22s ease;
  }
  @keyframes sp-nav-in {
    from { opacity: 0; transform: translateY(-10px); }
    to   { opacity: 1; transform: translateY(0); }
  }
  .site-nav #open-login-modal { margin-top: 16px; }
  .site-nav a {
    display: flex;
    flex-direction: row;
    align-items: center;
    gap: 10px;
    padding: 14px 8px;
    font-size: 1.05rem;
    font-weight: 600;
    letter-spacing: 0.04rem;
    opacity: 1;
  }
  .site-nav a .nav-badge { margin-left: 0; }
  .site-nav__label { margin-top: 0; }
  .site-nav__sub-links {
    display: block;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 4px;
  }
  .site-nav__sub-links a {
    font-size: 0.82rem;
    color: var(--text-muted);
    font-weight: 500;
    letter-spacing: 0.02em;
    padding: 10px 8px;
  }
  /* PC用ドロップダウン・chevronをSPで非表示 */
  .user-menu { display: none; }
  .nav-dropdown { display: none !important; }
  .nav-drop-chevron { display: none; }
  .nav-item-with-drop { display: contents; }
  /* SP専用：アカウント名ヘッダー */
  .sp-user-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 4px 8px 16px;
    border-bottom: 1px solid var(--line);
    margin-bottom: 4px;
  }
  .sp-user-header__icon svg { width: 24px; height: 24px; color: var(--text-muted); }
  .sp-user-header__name { font-size: 0.95rem; font-weight: 700; }
  /* SP専用：アカウントサブリンク */
  .sp-user-links {
    display: block;
    border-top: 1px solid var(--line);
    margin-top: 8px;
    padding-top: 4px;
  }
  .sp-user-links a { font-size: 1.05rem; font-weight: 600; letter-spacing: 0.04rem; color: var(--text); opacity: 1; }
  /* SP dropdownも行方向に */
  .user-menu__dropdown .user-menu__item { flex-direction: row; }
  body.is-portal .site-main,
  body.is-public .site-main { padding-bottom: calc(env(safe-area-inset-bottom, 0px) + 110px); }
}

/* === Bottom nav (mobile only) === */
.bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  background: #fff;
  border-top: 1px solid var(--line);
  z-index: 900;
  padding: 8px 4px calc(env(safe-area-inset-bottom, 0px) + 4px);
}
.bottom-nav a {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  padding: 6px 2px;
  color: var(--text-muted);
  font-size: 0.65rem;
  text-decoration: none;
  text-align: center;
}
.bottom-nav a:hover { color: var(--primary); }
.bottom-nav a.is-active { color: var(--primary); }
.bottom-nav a svg { width: 22px; height: 22px; stroke-width: 1.8; }
.bottom-nav__favicon {
  width: 20px;
  height: 20px;
  border-radius: 5px;
  object-fit: contain;
  border: 2.5px solid var(--text-muted);
  padding: 3px;
}
.bottom-nav a.is-active .bottom-nav__favicon { border-color: var(--primary); }
.bottom-nav__account .bottom-nav__favicon { display: none; }
.bottom-nav__account.has-favicon .bottom-nav__favicon { display: block; }
.bottom-nav__account.has-favicon svg { display: none; }
@media (max-width: 880px) {
  .bottom-nav { display: flex; }
  .site-footer { padding-bottom: calc(64px + env(safe-area-inset-bottom, 0px)); }
}

/* === Buttons === */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid transparent;
  background: var(--primary);
  color: #fff;
  padding: 12px 20px;
  border-radius: 10px;
  font-weight: 600;
  font-size: 0.95rem;
  cursor: pointer;
  transition: all 0.15s ease;
  text-decoration: none;
  white-space: nowrap;
}
.btn:hover { background: var(--primary-2); color: #fff; box-shadow: var(--shadow); }
.btn:not(.btn--ghost):hover { box-shadow: 0 4px 20px rgba(255, 90, 54, 0.35); }
.btn--ghost { background: #fff; border-color: var(--line-strong); color: var(--text); }
.btn--ghost:hover { background: var(--surface-2); color: var(--text); }
.btn.btn--soft { background: var(--primary-soft); border-color: transparent; color: var(--primary); }
.btn.btn--soft:hover { background: var(--primary); color: #fff; }
.btn--sm { padding: 8px 14px; font-size: 0.85rem; }
.btn--nowrap { white-space: nowrap; }
.btn--xs { padding: 4px 10px; font-size: 0.75rem; border-radius: 6px; }
.btn svg { width: 16px; height: 16px; stroke-width: 2; }
.btn--sm svg { width: 14px; height: 14px; }
.btn--xs svg { width: 12px; height: 12px; }
.btn--lg { padding: 16px 32px; font-size: 1rem; }
.btn--danger { background: var(--danger); }
.btn--success { background: var(--success); color: #fff; }

/* === Hero === */
.hero__inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 48px;
  align-items: center;
}
.hero__text { min-width: 0; }
.hero__visual {
  display: flex;
  align-items: center;
  justify-content: center;
}

/* Hero layered illustration */
.hero__stack {
  position: relative;
  width: 100%;
  max-width: 480px;
  overflow: hidden;
  border-radius: 24px;
}
.hero__img-people {
  width: 100%;
  display: block;
}
.hero__img-icons {
  position: absolute;
  top: 0; left: 0;
  width: 100%;
  animation: float 7s ease-in-out infinite;
  pointer-events: none;
}

/* Floating animation */
@keyframes float {
  0%, 100% { transform: translateY(0px) rotate(0deg); }
  33%       { transform: translateY(-6px) rotate(0.4deg); }
  66%       { transform: translateY(-3px) rotate(-0.4deg); }
}

/* Site-wide scroll-in animation */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 1.9s cubic-bezier(0.22,1,0.36,1), transform 1.9s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity, transform;
}
.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}
.reveal--fade {
  opacity: 0;
  transition: opacity 1.9s cubic-bezier(0.22,1,0.36,1);
  will-change: opacity;
}
.reveal--fade.is-visible {
  opacity: 1;
}
@media (max-width: 768px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { display: none; }
}
.hero-area {
  background: linear-gradient(160deg, #ffffff 0%, #fff5f1 45%, #eef3ff 100%);
}
.hero {
  position: relative;
  padding: 96px 0 80px;
  background: transparent;
  overflow: hidden;
  isolation: isolate;
}
.hero::before {
  content: '';
  position: absolute;
  top: -80px;
  right: -120px;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(255,90,54,0.07) 0%, transparent 65%);
  z-index: 0;
  pointer-events: none;
}
.hero h1 {
  font-size: clamp(2rem, 5vw, 3.6rem);
  line-height: 1.2;
  margin: 0 0 24px;
  letter-spacing: -0.01em;
}
.hero h1 .accent {
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__lead {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 640px;
  margin-bottom: 32px;
}
.hero__cta {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-start;
}
.hero__stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  gap: 24px;
  margin-top: 56px;
  padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero__stat .num {
  font-size: 2rem;
  font-weight: 800;
  background: linear-gradient(120deg, var(--primary), var(--accent));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.hero__stat .label {
  font-size: 0.8rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
}

/* === Sections === */
.section {
  padding: 80px 0;
}
.section--alt {
  background: var(--bg-2);
}

/* 強みセクション（ヒーロー直下・中央寄せ） */
.section--strength {
  background: transparent;
  padding: 40px 0 48px;
}
.strength__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  text-align: center;
}
.strength__item { padding: 0 16px; }
.strength__num {
  display: inline-block;
  font-size: 1.5rem;
  font-weight: 900;
  color: var(--primary);
  margin-bottom: 8px;
}
.strength__item h3 {
  font-size: 1rem;
  font-weight: 700;
  margin: 0 0 8px;
}
.strength__item p {
  font-size: 0.88rem;
  color: var(--text-muted);
  line-height: 1.7;
  margin: 0;
}
@media (max-width: 640px) {
  .strength__grid { grid-template-columns: 1fr; gap: 24px; }
}
#works { display: none; }
#pricing { display: none; }
#flow.section--alt {
  position: relative;
  background: var(--bg);
  padding: 48px 0;
  overflow: hidden;
}
#flow.section--alt > .container {
  position: relative;
  z-index: 1;
}
#flow.section--alt::before {
  content: ''; position: absolute; inset: 0;
  pointer-events: none; z-index: 0;
  background: linear-gradient(to right, var(--bg-2) 0%, transparent 60%);
}
.contact-card h2 { text-align: center; margin-bottom: 8px; font-size: 1.5rem !important; }
.contact-card__lead { text-align: center; margin-left: auto; margin-right: auto; margin-bottom: 0; }
#contact .form > div:last-child { text-align: center; margin-top: -8px; }
#contact .form > div:last-child .btn { width: 100%; justify-content: center; }
#contact .form .field:has(.checkbox-label) { margin-top: -8px; }
.contact-card {
  max-width: 680px;
  margin: 32px auto 0;
  background: var(--surface);
  box-shadow: 0 4px 24px rgba(0,0,0,0.08);
}
.contact-card .form { max-width: 100%; }
.section h2 {
  font-size: clamp(1.6rem, 3vw, 2.2rem);
  margin: 0 0 12px;
  letter-spacing: -0.01em;
}
.section h2::after,
.strength__title::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
  margin-top: 10px;
  opacity: 0;
  transition: opacity 0.4s ease;
}
.section h2.is-visible::after,
.strength__title.is-visible::after {
  opacity: 1;
  transition-delay: 0.5s;
}
.strength__title::after { margin-left: auto; margin-right: auto; }
.contact-card h2::after { display: none; }
.checkbox-label { display: flex; align-items: center; gap: 8px; cursor: pointer; font-size: 0.9rem; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); flex-shrink: 0; }
.section__lead {
  color: var(--text-muted);
  margin-bottom: 40px;
  max-width: 640px;
}

/* === Cards === */
.cards {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 20px;
}
@media (max-width: 880px) {
  .cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .cards { grid-template-columns: 1fr; }
}

/* === Stats grid (固定4列・レスポンシブ) === */
.stats-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.stats-grid--3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 880px) {
  .stats-grid,
  .stats-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 480px) {
  .stats-grid,
  .stats-grid--3 { grid-template-columns: repeat(2, 1fr); }
}
.stat-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
  min-width: 0;
}
@media (max-width: 880px) {
  .stat-card { padding: 14px 14px 8px 14px; }
}
.stat-card__label {
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--text-muted);
  margin: 0;
}
.stat-card__num {
  font-size: 1.8rem;
  font-weight: 700;
  margin: 0;
  overflow-wrap: break-word;
  text-align: right;
}
.stat-card__num--primary { color: var(--primary); }
.stat-card__num--success { color: var(--success); }
.stat-card__num--accent { color: var(--accent); }
.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 30px 29px 32px 29px;
  transition: all 0.2s ease;
  box-shadow: var(--shadow);
}
.card:hover {
  border-color: var(--primary);
}
.card.contact-card:hover { border-color: var(--line); }
.card--static { display: block !important; }
.card--static:hover { border-color: var(--line); box-shadow: var(--shadow); }
.card__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 12px;
}
.card__icon svg { width: 22px; height: 22px; stroke-width: 2; }
.card h3 {
  margin: 0 0 4px;
  font-size: 1rem;
  color: var(--text);
}
.card p {
  color: var(--text-muted);
  margin: 0;
  font-size: 0.9rem;
  line-height: 1.4rem;
}

/* === Service tags === */
/* サービス 1本ずつセクション */
#services.section { padding-bottom: 0; }
.svc-section { padding: 72px 0; }
.svc-section--alt { background: var(--bg-2); }

/* PC: svc-section スクロール横移動グラデーション */
@media (min-width: 881px) {
  .svc-section { position: relative; }
  .svc-section > .container { position: relative; z-index: 1; }
  .svc-section::before {
    content: '';
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
  }
  .svc-section--alt::before {
    background: radial-gradient(ellipse 60% 80% at 70% 50%, rgba(99, 102, 241, 0.06) 0%, transparent 70%);
  }
}
.svc-panel {
  display: flex;
  align-items: center;
  gap: 48px;
}
.svc-panel__img {
  width: 420px;
  flex-shrink: 0;
  background: var(--surface);
  border-radius: 24px;
  padding: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-lg);
}
.svc-panel__body { flex: 1; min-width: 0; }
.svc-panel--rev .svc-panel__img { order: 2; }
.svc-panel--rev .svc-panel__body { order: 1; }
.svc-panel__img img {
  display: block;
  width: 100%;
  max-width: 320px;
  height: 260px;
  object-fit: contain;
  mix-blend-mode: multiply;
}
.svc-panel__num {
  display: inline-block;
  font-size: 3.5rem;
  font-weight: 900;
  color: var(--primary);
  opacity: 0.12;
  line-height: 1;
  margin-bottom: 4px;
}
.svc-panel__body h3 {
  font-size: 1.5rem;
  font-weight: 800;
  margin: 0 0 12px;
}
.svc-panel__body > p {
  font-size: 1rem;
  color: var(--text-muted);
  margin: 0 0 20px;
  line-height: 1.7;
}
@media (max-width: 880px) {
  .svc-section { padding: 0 0 43px 0; }
  #contact.section { padding: 30px 0 0 0; }
  .svc-panel {
    flex-direction: column;
    gap: 0;
    align-items: stretch;
  }
  /* bodyをdisplay:contentsにして子要素をpanelの直接flex itemとして扱う */
  .svc-panel__body { display: contents; }

  /* SP表示順: num(1) → h3(2) → img(3) → p(4) → feature(5) → tags(6) */
  .svc-panel .svc-panel__num {
    order: 1;
    font-size: 2.2rem;
    margin: 0 0 2px;
  }
  .svc-panel__body h3 {
    order: 2;
    font-size: 1.2rem;
    margin: 0 0 14px;
  }
  .svc-panel__img {
    order: 3;
    width: 100%;
    border-radius: 16px;
    padding: 20px;
    margin-bottom: 14px;
  }
  .svc-panel__img img { height: 180px; }
  .svc-panel__body > p { order: 4; font-size: 0.9rem; margin-bottom: 10px; }
  .svc-panel .feature__list { order: 5; }
  .svc-panel .tag-list { order: 6; }

  /* 反転パネルのorderをSPでリセット */
  .svc-panel--rev .svc-panel__img { order: 3; }
}

/* 強みタイトル */
.strength__title { text-align: center; margin-bottom: 32px; }

.feature__list {
  list-style: none;
  margin: 12px 0 16px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
  flex: 1;
}
.feature__list li {
  font-size: 0.85rem;
  color: var(--text-muted);
  padding-left: 16px;
  position: relative;
  line-height: 1.5;
}
.feature__list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--primary);
  font-size: 0.78rem;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}
.tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 0.78rem;
  color: var(--text-muted);
}

/* === Flow === */
/* === Flow Steps (横並びステッパー) === */
.flow-steps {
  display: grid;
  grid-template-columns: 1fr auto 1fr auto 1fr auto 1fr auto 1fr;
  align-items: start;
  gap: 0;
  margin-top: 8px;
}
.flow-step {
  text-align: center;
  padding: 0 20px;
  position: relative;
}
.flow-step__badge {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 1rem;
  font-weight: 900;
  letter-spacing: 0.02em;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  box-shadow: 0 4px 12px rgba(233,93,44,0.35);
  position: relative;
  z-index: 1;
}
.flow-step__img {
  width: 120px;
  height: 120px;
  object-fit: contain;
  margin: 0 auto 14px;
  display: block;
  mix-blend-mode: multiply;
}
.flow-step h4 {
  font-size: 0.95rem;
  font-weight: 700;
  margin: 0 0 8px;
  letter-spacing: -0.01em;
}
.flow-step p {
  font-size: 0.78rem;
  color: var(--text-muted);
  line-height: 1.65;
  margin: 0;
}
.flow-step__arrow {
  display: flex;
  align-items: center;
  justify-content: center;
  align-self: center;
  color: var(--primary);
  opacity: 0.35;
}
.flow-step__arrow svg {
  width: 22px;
  height: 22px;
  stroke: var(--primary);
  stroke-width: 2;
}
@media (max-width: 860px) {
  .flow-steps {
    grid-template-columns: 1fr 1fr;
    gap: 24px 16px;
  }
  .flow-step__arrow { display: none; }
}
@media (max-width: 480px) {
  .flow-steps { grid-template-columns: 1fr; gap: 20px; }
}

/* === Pricing === */
.pricing {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 24px;
}
.pricing__plan {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 32px;
  text-align: center;
  box-shadow: var(--shadow);
}
.pricing__plan--featured {
  border-color: var(--primary);
  box-shadow: 0 0 0 2px var(--primary), 0 12px 32px rgba(255, 90, 54, 0.12);
}
.pricing__plan h3 { margin: 0 0 8px; }
.pricing__plan .price {
  font-size: 2rem;
  font-weight: 800;
  margin: 16px 0;
}
.pricing__plan .price small {
  font-size: 0.85rem;
  color: var(--text-muted);
  font-weight: 400;
}
.pricing__plan ul {
  list-style: none;
  padding: 0;
  margin: 16px 0 24px;
  text-align: left;
}
.pricing__plan li {
  padding: 8px 0;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
}
.pricing__plan li:last-child { border-bottom: none; }
.pricing__plan li::before {
  content: "";
  display: inline-block;
  width: 16px;
  height: 16px;
  margin-right: 10px;
  vertical-align: -3px;
  background: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%2316a34a' stroke-width='3' stroke-linecap='round' stroke-linejoin='round'><polyline points='20 6 9 17 4 12'/></svg>") no-repeat center / contain;
}

/* === Forms === */
.form {
  display: grid;
  gap: 16px;
  max-width: 640px;
}
.form-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
@media (max-width: 880px) {
  .form-row { grid-template-columns: 1fr !important; }
  /* 姓・名・電話の3カラム行 → SPでは姓/名を2カラム、電話を次行で全幅 */
  .form-row.form-row--seimei { grid-template-columns: 1fr 1fr !important; }
  .form-row.form-row--seimei > .field:nth-child(3) { grid-column: 1 / -1; }
  /* 2カラムをSPでも維持する行（部署/役職 など） */
  .form-row.form-row--keep2 { grid-template-columns: 1fr 1fr !important; }
  /* 保存ボタンをSPだけ全幅 */
  .form-save .btn { width: 100%; justify-content: center; }
}
.hover-tip,
.ip-tip { position: relative; cursor: help; display: inline-block; }
.hover-tip__body,
.ip-tip__body {
  display: none;
  position: absolute;
  bottom: calc(100% + 6px);
  right: 0;
  background: #ffffff;
  color: var(--text);
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--line-strong);
  font-size: 0.78rem;
  line-height: 1.5;
  white-space: normal;
  width: 320px;
  max-width: min(360px, 80vw);
  z-index: 100;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12);
  word-break: break-all;
  text-align: left;
}
code { word-break: break-all; }
.hover-tip__body code,
.ip-tip__body code { background: var(--surface-2); padding: 2px 4px; border-radius: 3px; color: var(--text); }
.hover-tip__body::before,
.ip-tip__body::before {
  content: '';
  position: absolute;
  top: 100%;
  right: 11px;
  border: 7px solid transparent;
  border-top-color: var(--line-strong);
}
.hover-tip__body::after,
.ip-tip__body::after {
  content: '';
  position: absolute;
  top: 100%;
  right: 12px;
  border: 6px solid transparent;
  border-top-color: #ffffff;
}
.hover-tip__body pre {
  margin: 4px 0 0;
  background: var(--surface-2);
  padding: 8px;
  border-radius: 4px;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-all;
  max-height: 240px;
  overflow-y: auto;
  color: var(--text);
}
.hover-tip:hover .hover-tip__body,
.hover-tip:focus-within .hover-tip__body,
.ip-tip:hover .ip-tip__body,
.ip-tip:focus-within .ip-tip__body { display: block; }

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: flex-end;
}
.filter-row .field { flex: 1 1 130px; min-width: 100px; }
.filter-row .field select,
.filter-row .field input { width: 100%; }
@media (max-width: 720px) {
  .filter-row { flex-direction: column; align-items: stretch; }
  .filter-row .field { flex: 1 1 auto; }
}
.field label {
  display: block;
  font-size: 0.88rem;
  margin-bottom: 6px;
  color: var(--text);
  font-weight: 500;
}
.field input,
.field select,
.field textarea {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 12px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: all 0.15s ease;
}
.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.12);
}
.field textarea { min-height: 140px; resize: vertical; }

/* === Input with leading icon === */
.input-with-icon {
  position: relative;
}
.input-with-icon > input {
  padding-left: 44px;
}
.input-with-icon__icon {
  position: absolute;
  left: 14px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-muted);
  pointer-events: none;
  display: inline-flex;
}
.input-with-icon__icon svg {
  width: 18px;
  height: 18px;
  stroke-width: 2;
}
.input-with-icon > input:focus ~ .input-with-icon__icon,
.input-with-icon:focus-within .input-with-icon__icon {
  color: var(--primary);
}

/* パス表示切替トグル */
.input-with-icon--toggle > input {
  padding-right: 44px;
}
.input-with-icon__toggle {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 8px;
  border-radius: 6px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.15s ease;
}
.input-with-icon__toggle:hover { color: var(--primary); background: var(--surface-2); }
.input-with-icon__toggle svg { width: 18px; height: 18px; stroke-width: 2; }

/* === Standalone select (table内など、.fieldラッパーなし) === */
/* 全てのselectでLucide chevron-down矢印に統一 */
select,
select.select,
.field select,
.table select {
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%236b7280' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'><polyline points='6 9 12 15 18 9'/></svg>");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 16px;
  background-color: #fff;
  padding-right: 34px;
}
select.select,
.table select {
  border: 1px solid var(--line-strong);
  border-radius: 8px;
  padding: 7px 30px 7px 12px;
  color: var(--text);
  font-size: 0.85rem;
  font-family: inherit;
  cursor: pointer;
  transition: all 0.15s ease;
  min-width: 110px;
}
select.select:hover,
.table select:hover { border-color: var(--primary); }
select.select:focus,
.table select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.12);
}

/* === Typeahead === */
.typeahead { position: relative; }
.typeahead__list {
  position: absolute;
  top: calc(100% + 4px);
  left: 0;
  right: 0;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  box-shadow: var(--shadow-lg);
  z-index: 30;
  max-height: 320px;
  overflow-y: auto;
}
.typeahead__item {
  padding: 10px 14px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.typeahead__item:last-child { border-bottom: none; }
.typeahead__item:hover {
  background: var(--primary-soft);
}
.typeahead__item-name {
  font-weight: 600;
  color: var(--text);
  margin-bottom: 2px;
}
.typeahead__item-meta {
  font-size: 0.82rem;
  color: var(--text-muted);
}
.typeahead__empty {
  padding: 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 0.88rem;
}

/* === Drag & Drop Upload === */
.dropzone {
  position: relative;
  display: block;
  border: 2px dashed var(--line-strong);
  border-radius: var(--radius-lg);
  background: var(--surface-2);
  padding: 36px 24px;
  text-align: center;
  cursor: pointer;
  transition: all 0.18s ease;
}
.dropzone:hover {
  border-color: var(--primary);
  background: var(--primary-soft);
}
.dropzone--active {
  border-color: var(--primary);
  background: var(--primary-soft);
  transform: scale(1.01);
}
.dropzone__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: var(--primary-soft);
  color: var(--primary);
  margin-bottom: 12px;
}
.dropzone__icon svg { width: 28px; height: 28px; stroke-width: 2; }
.dropzone__text {
  font-weight: 600;
  color: var(--text);
  margin: 0 0 4px;
}
.dropzone__hint {
  font-size: 0.85rem;
  color: var(--text-muted);
  margin: 0;
}
.dropzone__input {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  cursor: pointer;
}
.dropzone__file {
  margin-top: 12px;
  padding: 10px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  font-size: 0.88rem;
  color: var(--text);
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.dropzone__file-remove {
  background: none;
  border: none;
  color: var(--text-muted);
  cursor: pointer;
  padding: 0 4px;
  display: inline-flex;
  align-items: center;
}
.dropzone__file-remove svg { width: 16px; height: 16px; }
.dropzone__file-remove:hover { color: var(--danger); }
.dropzone__file svg { width: 16px; height: 16px; }
.dropzone__file-thumb {
  width: 36px;
  height: 36px;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid var(--line);
  vertical-align: middle;
  background: var(--surface-2);
}

/* === ファイル一覧サムネ === */
.file-thumb {
  width: 48px;
  height: 48px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--line);
  display: block;
  background: var(--surface-2);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
a:hover > .file-thumb {
  transform: scale(1.05);
  box-shadow: var(--shadow);
  border-color: var(--primary);
}
.file-thumb--icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
}
.file-thumb--icon svg { width: 22px; height: 22px; }

.upload-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  margin-bottom: 16px;
  box-shadow: var(--shadow);
}
.upload-form__row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
  align-items: end;
  margin-top: 12px;
}
.upload-form__row .field input {
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}
.upload-form__row .btn {
  height: 44px;
  padding-top: 0;
  padding-bottom: 0;
}
@media (max-width: 600px) {
  .upload-form__row { grid-template-columns: 1fr; }
}

/* === Auth === */
.auth-card {
  max-width: 420px;
  margin: 80px auto;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 40px;
  box-shadow: var(--shadow-lg);
}
.auth-card h1 {
  margin: 0 0 8px;
  font-size: 1.5rem;
}
.auth-card p { color: var(--text-muted); margin: 0 0 24px; }

/* === Portal === */
.portal-grid {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 32px;
  padding: 32px 0 80px;
}
@media (max-width: 880px) {
  .portal-grid { grid-template-columns: 1fr; }
}
.portal-aside {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  height: fit-content;
  box-shadow: var(--shadow);
}
.portal-aside h4 {
  margin: 0 0 12px;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  color: var(--text-muted);
  text-transform: uppercase;
}
.portal-aside ul {
  list-style: none;
  padding: 0;
  margin: 0;
}
.portal-aside li a {
  display: block;
  padding: 8px 12px;
  border-radius: 8px;
  color: var(--text);
  font-size: 0.92rem;
}
.portal-aside li a:hover { background: var(--surface-2); }
.portal-aside li a.active { background: var(--primary); color: #fff; }

/* === Project Dashboard === */
.dash-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 16px;
  margin-bottom: 24px;
}
.dash-header h1 { margin: 0; font-size: 1.5rem; }
.dash-header .meta { color: var(--text-muted); font-size: 0.88rem; margin-top: 6px; }
.flex-row-gap { display: flex; align-items: center; gap: 8px; }

.progress-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  margin-bottom: 24px;
  box-shadow: var(--shadow);
}
.progress-bar {
  width: 80px;
  height: 10px;
  background: var(--surface-2);
  border-radius: 999px;
  overflow: hidden;
  flex-shrink: 0;
}
.progress-bar__fill {
  height: 100%;
  background: linear-gradient(90deg, var(--primary), var(--primary-2));
  transition: width 0.3s ease;
}
.progress-wrap { display: flex; align-items: center; gap: 8px; }

/* === Projects table: SP card layout === */
@media (max-width: 880px) {
  .table.table--projects { background: none; border: none; box-shadow: none; border-radius: 0; }
  .table.table--projects thead { display: none; }
  .table.table--projects tbody { display: grid; gap: 10px; }
  .table.table--projects tbody tr {
    display: grid;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .table.table--projects tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    border-top: none;
    font-size: 0.875rem;
    gap: 10px;
  }
  .table.table--projects tbody td:last-child { border-bottom: none; }
  .table.table--projects tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .table.table--projects td.td-name {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 14px;
    border-bottom: 1px solid var(--line);
    font-size: 0.95rem;
  }
  .table.table--projects td.td-progress .progress-bar { width: auto; flex: 1; }
  .table.table--projects td.td-action {
    justify-content: flex-end;
    padding: 8px 14px;
  }
  .table.table--projects td.td-action::before { display: none; }
}

/* === Contracts table: SP card layout === */
.table.table--contracts td.td-action { text-align: right; white-space: nowrap; }
@media (max-width: 880px) {
  .table.table--contracts { background: none; border: none; box-shadow: none; border-radius: 0; }
  .table.table--contracts thead { display: none; }
  .table.table--contracts tbody { display: grid; gap: 10px; }
  .table.table--contracts tbody tr {
    display: grid;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .table.table--contracts tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    border-top: none;
    font-size: 0.875rem;
    gap: 10px;
  }
  .table.table--contracts tbody td:last-child { border-bottom: none; }
  .table.table--contracts tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .table.table--contracts td.td-title {
    padding: 12px 14px;
    font-size: 0.95rem;
  }
  .table.table--contracts td.td-action { justify-content: flex-end; }
  .table.table--contracts td.td-action::before { display: none; }
}

/* === Tasks table: PC で アクション列を右寄せ === */
@media (min-width: 801px) {
  .table--tasks th.th-action,
  .table--tasks td.td-action {
    text-align: right;
    white-space: nowrap;
  }
}

/* === Files table: SP card layout === */
@media (max-width: 880px) {
  .table.table--files { background: none; border: none; box-shadow: none; border-radius: 0; }
  .table.table--files thead { display: none; }
  .table.table--files tbody { display: grid; gap: 10px; }
  .table.table--files tbody tr {
    display: grid;
    grid-template-columns: 56px 1fr auto;
    grid-template-areas:
      "thumb name action"
      "note  note  note"
      "size  size  size"
      "date  date  date";
    align-items: center;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
    padding: 10px 12px;
    gap: 4px 10px;
  }
  .table.table--files tbody td {
    border: none;
    border-bottom: 1px solid var(--line);
    padding: 6px 0;
    font-size: 0.875rem;
  }
  .table.table--files tbody td.td-thumb {
    grid-area: thumb;
    padding: 0;
    border-bottom: none;
  }
  .table.table--files tbody td.td-name {
    grid-area: name;
    padding: 0;
    font-size: 0.95rem;
    font-weight: 600;
    border-bottom: none;
    word-break: break-all;
  }
  .table.table--files tbody td.td-action {
    grid-area: action;
    padding: 0;
    border-bottom: none;
    text-align: right;
  }
  .table.table--files tbody td.td-note { grid-area: note; }
  .table.table--files tbody td.td-size { grid-area: size; }
  .table.table--files tbody td.td-date { grid-area: date; padding-bottom: 0; border-bottom: none; }
  .table.table--files tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    margin-right: 8px;
  }
  .table.table--files tbody td[data-label] {
    display: flex;
    align-items: center;
    justify-content: flex-start;
    gap: 4px;
  }
}

/* === Invoices table: SP card layout === */
@media (max-width: 880px) {
  .table.table--invoices { background: none; border: none; box-shadow: none; border-radius: 0; }
  .table.table--invoices thead { display: none; }
  .table.table--invoices tbody { display: grid; gap: 10px; }
  .table.table--invoices tbody tr {
    display: grid;
    background: var(--surface);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    overflow: hidden;
  }
  .table.table--invoices tbody td {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 14px;
    border-bottom: 1px solid var(--line);
    border-top: none;
    font-size: 0.875rem;
    gap: 10px;
  }
  .table.table--invoices tbody td:last-child { border-bottom: none; }
  .table.table--invoices tbody td[data-label]::before {
    content: attr(data-label);
    font-size: 0.72rem;
    color: var(--text-muted);
    font-weight: 600;
    letter-spacing: 0.04em;
    flex-shrink: 0;
  }
  .table.table--invoices td.td-no {
    padding: 12px 14px;
    font-size: 0.95rem;
    font-weight: 600;
  }
  .table.table--invoices td.td-no::before { display: none; }
  .table.table--invoices td.td-action { justify-content: flex-end; }
  .table.table--invoices td.td-action::before { display: none; }
  .stat-card__num { font-size: 1.3rem; }
}

/* === Status badges === */
.badge {
  display: inline-block;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  white-space: nowrap;
}
/* 「待ち」系（未読・署名待ち・入金待ち等）はprofileサイドバー active と同じ primary 系で統一 */
.badge--planning,
.badge--in_progress,
.badge--issued,
.badge--sent,
.badge--active,
.badge--info       { background: var(--primary-soft); color: var(--primary); }
.badge--review     { background: var(--warn-soft); color: var(--warn); }
.badge--delivered  { background: var(--success-soft); color: var(--success); }
.badge--on_hold,
.badge--cancelled  { background: var(--surface-2); color: var(--text-muted); }
.badge--todo       { background: var(--surface-2); color: var(--text-muted); }
.badge--done       { background: var(--success-soft); color: var(--success); }
.badge--blocked    { background: var(--danger-soft); color: var(--danger); }
.badge--draft      { background: var(--surface-2); color: var(--text-muted); }
.badge--paid       { background: var(--success-soft); color: var(--success); }
.badge--overdue    { background: var(--danger-soft); color: var(--danger); }

/* === Project layout (sidebar) === */
.project-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
}
.project-side {
  position: sticky;
  top: 88px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}
.project-side__nav {
  display: flex;
  flex-direction: column;
  border-left: 2px solid var(--line);
}
.project-side__link {
  padding: 8px 14px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.4;
  text-decoration: none;
}
.project-side__link:hover { color: var(--text); }
.project-side__link.is-active {
  color: var(--primary);
  border-left-color: var(--primary);
  font-weight: 600;
}
.project-side__site {
  padding: 12px 14px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  word-break: break-all;
}
.project-main { min-width: 0; }
.project-main h2[id] { scroll-margin-top: 88px; }
.project-main .progress-card { scroll-margin-top: 88px; }
@media (max-width: 800px) {
  /* プロジェクト詳細ページ：固定サブナビ分だけsitemainを下げる */
  .site-main:has(.project-layout) { padding-top: 40px; }
  .project-layout { grid-template-columns: minmax(0, 1fr); padding-top: 44px; }
  .project-side {
    position: fixed;
    top: 64px;
    left: 0;
    right: 0;
    min-width: 0;
    z-index: 40;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: saturate(160%) blur(8px);
    -webkit-backdrop-filter: saturate(160%) blur(8px);
    width: 100vw;
    padding: 0;
    box-sizing: border-box;
  }
  .project-side__site { display: none; }
  .project-side__nav {
    flex-direction: row;
    overflow-x: auto;
    border-left: none;
    border-bottom: 2px solid var(--line);
    min-width: 0;
    max-width: 100%;
  }
  .project-side__link { white-space: nowrap; border-left: none; border-bottom: 2px solid transparent; margin-left: 0; margin-bottom: -2px; }
  .project-side__link.is-active { border-left: none; border-bottom-color: var(--primary); }
  /* SP: scroll-margin-top = site-header(64) + fixed-subnav(44) + gap(8) */
  .project-main h2[id] { scroll-margin-top: 116px; }
  .project-main .progress-card { scroll-margin-top: 116px; }
  /* SP: 横はみだし防止 */
  .project-main { overflow-x: clip; min-width: 0; }
  .project-main table.table { display: block; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .project-main code { word-break: break-all; overflow-wrap: anywhere; }
  .progress-card .progress-bar { width: 100%; }
  /* インラインで grid-template-columns を持つフォームは1列にする */
  .project-main form[style*="grid-template-columns"] {
    grid-template-columns: 1fr !important;
  }
  /* フォーム内の input/select/textarea が固定min-widthで押し広げないように */
  .project-main .field input,
  .project-main .field select,
  .project-main .field textarea { min-width: 0; max-width: 100%; }
  /* タスク内の status select も縮める */
  .project-main .table .select { max-width: 100%; }
  /* dash-header: タイトルとボタンを縦並びに */
  .dash-header { min-width: 0; }
  .dash-header > div { min-width: 0; max-width: 100%; }
  .dash-header h1 { font-size: 1.25rem; word-break: break-word; }
  .dash-header .meta { overflow-wrap: anywhere; }
}

/* === Analytics (SC/GA4) === */
.analytics-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.analytics-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
}
.analytics-card__head {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 14px;
  gap: 12px;
}
.analytics-metrics {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.analytics-metrics .metric { text-align: center; }
.analytics-metrics .metric__label {
  font-size: 0.7rem;
  color: var(--text-muted);
  margin: 0 0 4px;
  letter-spacing: 0.04em;
}
.analytics-metrics .metric__num {
  font-size: 1.3rem;
  font-weight: 700;
  margin: 0;
  font-variant-numeric: tabular-nums;
}
.analytics-note {
  margin: 12px 0 0;
  padding-top: 10px;
  border-top: 1px dashed var(--line);
}
@media (max-width: 800px) {
  .analytics-grid { grid-template-columns: 1fr; }
}

/* === Contracts === */
.contract-doc {
  display: block !important;
  font-family: 'ヒラギノ明朝 ProN', 'Yu Mincho', serif;
  line-height: 2;
  font-size: 0.95rem;
  padding: 32px 40px !important;
}
@media (max-width: 600px) {
  .contract-doc { padding: 16px !important; font-size: 0.875rem; }
  .contract-doc h1 { font-size: 1.1rem; letter-spacing: 0.1em; }
}
.contract-doc h1 { font-size: 1.4rem; text-align: center; margin: 0 0 24px; letter-spacing: 0.3em; }
.contract-doc h2 { font-size: 1rem; margin: 24px 0 8px; border-left: 3px solid var(--text); padding-left: 10px; font-weight: 600; }
.contract-doc p, .contract-doc ol, .contract-doc ul { margin: 8px 0; }
.contract-doc ol, .contract-doc ul { padding-left: 1.5em; }
.contract-doc .contract-date { text-align: center; margin: 32px 0 16px; }
.contract-signatures {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
  margin-top: 32px;
  padding-top: 24px;
  border-top: 1px dashed var(--line);
}
@media (max-width: 880px) {
  .contract-signatures { grid-template-columns: 1fr; }
}
.sig-block {
  padding: 8px 16px 7px 16px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--surface-2);
}
@media (max-width: 880px) {
  .sig-block { padding: 4px 16px 2px 14px; }
  /* iOS Safariでinputフォーカス時の自動ズーム抑止（font-size 16px 以上で抑止される） */
  input[type="text"],
  input[type="email"],
  input[type="tel"],
  input[type="url"],
  input[type="number"],
  input[type="password"],
  input[type="search"],
  input[type="date"],
  input[type="datetime-local"],
  select,
  textarea { font-size: 16px !important; }
}
.sig-name { font-size: 1.05rem; font-weight: 600; margin: 4px 0; }

.sign-banner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius);
  padding: 14px 18px;
}
@media (max-width: 600px) {
  .sign-banner { flex-direction: column; align-items: flex-start; gap: 8px; }
}
.sign-card {
  display: block !important;
  scroll-margin-top: 88px;
  width: 210mm;
  max-width: 100%;
  margin-left: auto;
  margin-right: auto;
}
.sign-card .sign-form { display: block; padding: 0 !important; }
@media (max-width: 880px) {
  .sign-card { display: block !important; flex-direction: column !important; align-items: stretch !important; padding: 15px 16px 18px 16px; }
  .sign-card > * { width: 100%; }
  .sign-card .sign-form > * { width: 100%; box-sizing: border-box; }
  .sign-card .sign-form .btn { width: 100%; justify-content: center; }
}
.sig-block__sign-toggle {
  margin-left: 10px;
  vertical-align: middle;
}
.sign-form { display: block !important; padding: 24px !important; }
.sign-form .field { margin-bottom: 20px; }
.sign-form .field:has(.checkbox-label) { margin-top: 12px; margin-bottom: 24px; }
.checkbox-label { display: flex !important; align-items: flex-start; gap: 8px; line-height: 1.6; cursor: pointer; }
.checkbox-label input { margin-top: 4px; width: auto !important; }

.badge--completed { background: var(--success-soft); color: var(--success); }

/* === A4 Paper (invoice / contract on-screen preview) === */
.paper-stage {
  background: #e9ecef;
  margin: 16px 0 0;
  padding: 24px 16px;
  display: flex;
  justify-content: center;
  overflow-x: auto;
  max-width: 100%;
}
.paper-a4 {
  width: 210mm;
  max-width: 100%;
  min-height: 297mm;
  padding: 18mm 16mm;
  background: #fff;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15);
  color: #111;
  font-family: "Hiragino Sans", "Yu Gothic", sans-serif;
  font-size: 12px;
  line-height: 1.6;
  box-sizing: border-box;
}
/* SP: A4比率を保ったまま縮小プレビュー */
@media (max-width: 880px) {
  .paper-stage {
    display: block;
    width: 100%;
    padding: 16px;
    overflow: hidden;
    margin: 16px 0 0;
    box-sizing: border-box;
  }
  .paper-a4 {
    width: 210mm;
    max-width: none;
    transform: scale(var(--paper-scale, 1));
    transform-origin: top left;
  }
}
.paper-a4 h1.doc-title { font-size: 24px; letter-spacing: 0.4em; text-align: center; margin: 0 0 24px; }
.paper-a4 .doc-head { display: flex; justify-content: space-between; margin-bottom: 24px; gap: 24px; }
.paper-a4 .doc-billto { font-size: 14px; flex: 1; line-height: 1.4; }
.paper-a4 .doc-billto .name { font-size: 18px; font-weight: 700; border-bottom: 1px solid #111; padding-bottom: 4px; margin-bottom: 6px; line-height: 1.3; }
.paper-a4 .doc-from { text-align: right; font-size: 11px; }
.paper-a4 .doc-from .corp { font-size: 14px; font-weight: 700; margin-bottom: 4px; }
.paper-a4 .doc-meta { font-size: 11px; }
.paper-a4 .doc-total-box { background: #f0f0f0; padding: 16px 20px; margin: 20px 0; }
.paper-a4 .doc-total-box .total-amount { font-size: 24px; font-weight: 800; }
.paper-a4 table.doc-table { width: 100%; border-collapse: collapse; margin-top: 16px; }
.paper-a4 table.doc-table th,
.paper-a4 table.doc-table td { border: 1px solid #999; padding: 8px 10px; text-align: left; font-size: 12px; line-height: 1.4; }
.paper-a4 table.doc-table th { background: #eee; }
.paper-a4 table.doc-table td.num,
.paper-a4 table.doc-table th.num { text-align: right; }
.paper-a4 .doc-bank { margin-top: 24px; border: 1px solid #999; padding: 12px; font-size: 11px; }
.paper-a4 .doc-footer-note { margin-top: 30px; font-size: 11px; color: #555; white-space: pre-wrap; }

@media print {
  .site-header, .site-footer, .site-nav, .dash-header, .sign-banner, .sign-form, .alert, .btn { display: none !important; }
  body, body.is-portal, body.is-public { background: #fff !important; margin: 0 !important; }
  .contract-doc { box-shadow: none !important; border: none !important; }
  .paper-stage { background: #fff !important; margin: 0 !important; padding: 0 !important; }
  .paper-a4 { box-shadow: none !important; width: auto !important; min-height: 0 !important; }
  .container { max-width: none !important; padding: 0 !important; }
  .site-main { padding: 0 !important; }
}
@page { size: A4; margin: 0; }

/* SP: A4比率を保ったままJSで scale 表示（横スクロールではなくフィット） */
@media (max-width: 900px) {
  .paper-stage {
    padding: 16px;
    margin: 16px 0 0;
    overflow: hidden;
    display: block;
    width: 100%;
    box-sizing: border-box;
    /* JS適用前に高さを確保しておきレイアウトシフトを防ぐ（A4比率） */
    height: calc((100vw - 32px) * 297 / 210 + 32px);
  }
  /* JSスケール適用前は紙を非表示にしてチラつきを防ぐ */
  .paper-stage .paper-a4 { visibility: hidden; }
  .paper-stage.is-ready .paper-a4 { visibility: visible; }
}

/* === Announcements === */
.announce-block {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 18px 20px;
  margin-top: 8px;
}
.announce-block__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.announce-block__head h2 {
  font-size: 1.05rem;
  margin: 0;
}
.announce-empty { padding: 12px 0; }
.announce-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
}
.announce-item {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 4px 16px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
}
.announce-item:first-child { border-top: none; }
.announce-item__meta {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  gap: 8px;
}
.announce-item__body p {
  margin: 4px 0 0;
  color: var(--text-muted);
}
.announce-item__actions {
  align-self: center;
}

/* === Tables === */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  overflow: hidden;
}
.table th, .table td {
  padding: 14px 12px;
  text-align: left;
  vertical-align: middle;
  border-bottom: 1px solid var(--line);
  font-size: 0.92rem;
  line-height: 1.3;
}
.table td.small.muted,
.table td .badge { white-space: nowrap; }
.table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; border-radius: var(--radius); }
.table th {
  background: var(--surface-2);
  font-weight: 600;
  font-size: 0.8rem;
  letter-spacing: 0.04em;
  color: var(--text-muted);
}
.table th:first-child { border-radius: var(--radius) 0 0 0; }
.table th:last-child  { border-radius: 0 var(--radius) 0 0; }
.table tr:last-child td { border-bottom: none; }
.table tr:last-child td:first-child { border-radius: 0 0 0 var(--radius); }
.table tr:last-child td:last-child  { border-radius: 0 0 var(--radius) 0; }
.table a { color: var(--text); }
.table a:hover { color: var(--primary); }

.table.table--invoices th,
.table.table--invoices td {
  font-size: 0.9rem;
  letter-spacing: 0.02rem;
}

.legal-note {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 18px;
  box-shadow: var(--shadow);
}
.legal-note > summary {
  cursor: pointer;
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
}
.legal-note > summary::-webkit-details-marker { display: none; }
.legal-note > summary svg {
  width: 18px;
  height: 18px;
  stroke: var(--primary);
  stroke-width: 2;
  flex-shrink: 0;
}
.legal-note > summary > span { flex: 1; }

/* === Inline lucide icons in text/links (excluding .btn) === */
.small svg.lucide,
p svg.lucide {
  width: 1em;
  height: 1em;
  vertical-align: -0.15em;
  stroke-width: 2;
}
.legal-note__chevron {
  stroke: var(--text-muted) !important;
  transition: transform 0.2s ease;
}
.legal-note[open] > summary .legal-note__chevron {
  transform: rotate(180deg);
}
.legal-note[open] > summary { margin-bottom: 12px; }
.legal-note__body {
  font-size: 0.88rem;
  line-height: 1.7;
  color: var(--text);
}
.legal-note__body ul {
  padding-left: 1.2em;
  margin: 8px 0;
}
.legal-note__body li { margin-bottom: 6px; }
.legal-note__body p { margin: 6px 0; }

/* === Logs / Comments === */
.log-list { display: grid; gap: 12px; }
.log-item {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  box-shadow: var(--shadow);
}
.log-item__head {
  display: flex;
  justify-content: space-between;
  font-size: 0.82rem;
  color: var(--text-muted);
  margin-bottom: 6px;
}
.log-item__body { white-space: pre-wrap; }

/* === Toast === */
.toast {
  position: fixed;
  bottom: 24px;
  right: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 14px 20px;
  box-shadow: var(--shadow-lg);
  z-index: 100;
  animation: slideIn 0.25s ease;
}
.toast--success { border-color: var(--success); }
.toast--error { border-color: var(--danger); }
@keyframes slideIn { from { transform: translateX(100%); opacity: 0; } to { transform: translateX(0); opacity: 1; } }

/* === Modal === */
.modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 35, 0.55);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  backdrop-filter: blur(3px);
}
.modal-backdrop.is-open {
  display: flex;
  animation: fadeIn 0.15s ease;
}
.modal {
  background: var(--surface);
  border-radius: 16px;
  max-width: 600px;
  width: 100%;
  max-height: calc(100vh - 48px);
  overflow: auto;
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.25);
  animation: modalIn 0.2s ease;
}
.modal--lightbox {
  background: transparent;
  box-shadow: none;
  max-width: 92vw;
  max-height: 92vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow: visible;
}
.modal--lightbox img {
  max-width: 100%;
  max-height: 88vh;
  display: block;
  border-radius: 12px;
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.4);
}
.modal__head {
  padding: 18px 24px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: sticky;
  top: 0;
  background: var(--surface);
  z-index: 1;
}
.modal__title { margin: 0; font-size: 1.05rem; }
.modal__close {
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  display: inline-flex;
  border-radius: 6px;
  transition: all 0.15s ease;
}
.modal__close:hover { color: var(--text); background: var(--surface-2); }
.modal__close svg { width: 18px; height: 18px; }
.modal--lightbox .modal__close {
  position: absolute;
  top: -12px;
  right: -12px;
  background: #fff;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
}
.modal--lightbox .modal__close svg { width: 16px; height: 16px; }
.modal__body { padding: 24px; }
.modal__footer {
  padding: 16px 24px;
  border-top: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.modal__footer-actions {
  display: flex;
  gap: 8px;
}
.file-info {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
  margin-bottom: 20px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}
.file-info__thumb {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 10px;
  border: 1px solid var(--line);
  display: block;
  background: var(--surface-2);
}
.file-info__icon {
  width: 96px;
  height: 96px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--surface-2);
  border-radius: 10px;
  border: 1px solid var(--line);
  color: var(--text-muted);
}
.file-info__icon svg { width: 36px; height: 36px; }
.file-info__name {
  margin: 0 0 4px;
  font-weight: 600;
  word-break: break-all;
}
.file-info__meta {
  margin: 0;
  font-size: 0.82rem;
  color: var(--text-muted);
}

@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes modalIn {
  from { transform: translateY(16px); opacity: 0; }
  to   { transform: translateY(0); opacity: 1; }
}

/* === Footer === */
.site-footer {
  background: var(--bg-2);
  border-top: 1px solid var(--line);
  padding: 12px 0;
  margin-top: 0;
  position: relative;
  overflow: visible;
}
.footer-couple { display: none; }
@media (min-width: 881px) {
  .footer-couple {
    display: block;
    position: absolute;
    bottom: 100%;
    left: 0;
    right: 0;
    height: 24px;
    pointer-events: none;
    z-index: 50;
  }
  .footer-couple__walker,
  .footer-couple__dance {
    position: absolute;
    bottom: 0;
    width: 24px;
    height: 24px;
    overflow: hidden;
    transform: translateY(2px);
    pointer-events: auto;
  }
  .footer-couple__walker { left: -40px; }
  .footer-couple__walker--right { transform: translateY(2px) scaleX(-1); }
  /* クリックで反転 */
  .footer-couple__walker--left.is-reversed  { transform: translateY(2px) scaleX(-1); }
  .footer-couple__walker--right.is-reversed { transform: translateY(2px) scaleX(1); }
  .footer-couple__dance {
    left: 0;
    display: none;
  }
  .footer-couple.is-dancing .footer-couple__walker { display: none; }
  .footer-couple.is-dancing .footer-couple__dance { display: block; }
  /* 歩行/走行の画像トグル */
  .footer-couple__walker-run { display: none; }
  .footer-couple__walker.is-running .footer-couple__walker-walk { display: none; }
  .footer-couple__walker.is-running .footer-couple__walker-run { display: block; }
  .footer-couple img {
    /* 8bit風: 粗いピクセル + var(--line) 相当の薄グレー */
    position: absolute;
    top: 0;
    left: 0;
    width: 10px;
    height: 10px;
    transform: scale(2.4);
    transform-origin: top left;
    image-rendering: pixelated;
    image-rendering: -moz-crisp-edges;
    image-rendering: crisp-edges;
    filter: brightness(0) invert(91%) sepia(7%) saturate(218%) hue-rotate(180deg);
  }
}
.site-footer__inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 8px 16px;
  font-size: 0.78rem;
  color: #9ca3af;
}
.site-footer__left,
.site-footer__right {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 16px;
}
.site-footer__brand-name { font-weight: 500; color: #9ca3af; }
.site-footer__inner a { color: #9ca3af; text-decoration: none; }
.site-footer__inner a:hover { color: var(--primary); text-decoration: underline; }
@media (max-width: 720px) {
  .site-footer__inner { justify-content: center; text-align: center; }
  .site-footer__left,
  .site-footer__right { justify-content: center; }
}

/* === Legal pages === */
.legal-page {
  max-width: 820px;
  margin: 0 auto 60px;
  padding: 48px 4px 0;
}
.legal-page__head {
  border-bottom: 1px solid var(--line);
  padding-bottom: 20px;
  margin-bottom: 28px;
}
.legal-page__head h1 {
  margin: 0 0 6px;
  font-size: 1.8rem;
}
.legal-page section { margin-bottom: 28px; }
.legal-page section h2 {
  font-size: 1.15rem;
  border-left: 0;
  padding: 0;
  margin: 0 0 10px;
  color: var(--text);
}
.legal-page section p,
.legal-page > p { line-height: 1.85; margin: 0 0 10px; }
.legal-page section ol,
.legal-page section ul { padding-left: 1.6em; line-height: 1.9; }
.legal-page section li { margin-bottom: 6px; }
.legal-page__table {
  width: 100%;
  border-collapse: collapse;
  margin: 12px 0;
}
.legal-page__table th,
.legal-page__table td {
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
  text-align: left;
  line-height: 1.7;
}
.legal-page__table th {
  width: 200px;
  background: var(--surface-2);
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
}
.legal-page__table tr:last-child th,
.legal-page__table tr:last-child td { border-bottom: none; }

.tax { font-size: 0.78em; opacity: 0.7; font-weight: 400; }
.legal-page__signoff {
  text-align: right;
  margin-top: 32px;
}
@media (max-width: 720px) {
  .legal-page__table th { width: 110px; padding: 10px 8px; font-size: 0.82rem; }
  .legal-page__table td { padding: 10px 8px; }
}
@media (max-width: 880px) {
  .legal-page { padding: 12px 4px 0; margin: 0 auto; }
  .legal-page__head { padding-bottom: 20px; margin-bottom: 20px; }
  .legal-page__head h1 { margin: 0 0 4px; font-size: 1.8rem; }
  .legal-page__head .meta { margin: 0; }
}

@media (min-width: 881px) {
  .site-footer {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    margin-top: 0;
    z-index: 30;
    padding: 10px 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(6px);
    -webkit-backdrop-filter: blur(6px);
  }
  body { padding-bottom: 44px; }
}
@media (max-width: 720px) {
  .site-footer__sep { display: none; }
  .site-footer__inner { gap: 4px 12px; }
}

/* === Profile sidebar layout === */
.profile-layout {
  display: grid;
  grid-template-columns: 200px 1fr;
  gap: 32px;
  align-items: start;
  margin-top: 24px;
  margin-bottom: 48px;
}
.profile-sidebar {
  display: flex;
  flex-direction: column;
  gap: 4px;
  position: sticky;
  top: 80px;
}
.profile-sidebar__item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  border-radius: 10px;
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 500;
  text-decoration: none;
  transition: background 0.15s, color 0.15s;
}
.profile-sidebar__item svg { width: 16px; height: 16px; stroke-width: 2; flex-shrink: 0; color: var(--text-muted); }
.profile-sidebar__item:hover { background: var(--surface-2); color: var(--text); }
.profile-sidebar__item.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.profile-sidebar__item.is-active svg { color: var(--primary); }
.profile-sidebar__sub {
  display: block;
  padding: 6px 14px 6px 40px;
  font-size: 0.82rem;
  color: var(--text-muted);
  text-decoration: none;
  border-radius: 8px;
  transition: background 0.15s, color 0.15s;
}
.profile-sidebar__sub:hover { background: var(--surface-2); color: var(--text); }
.profile-sidebar__sub.is-active { background: var(--primary-soft); color: var(--primary); font-weight: 600; }
.profile-main { min-width: 0; }
.profile-section-title { font-size: 1.05rem; margin: 28px 0 12px; border-bottom: 1px solid var(--line); padding-bottom: 8px; scroll-margin-top: 80px; }
.profile-section-title:first-child { margin-top: 0; }
.profile-tab-form {
  max-width: 440px;
  display: grid;
  gap: 14px;
}
.profile-tab-form .profile-section-title { margin: 0; }
.form .profile-section-title { margin-top: 8px; }
.form .profile-section-sub { margin-top: 4px; }
.input-disabled { opacity: 0.6; }
.input-password { position: relative; }
.input-password input { padding-right: 44px; }
.input-password__toggle {
  position: absolute;
  right: 10px;
  top: 50%;
  transform: translateY(-50%);
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  padding: 4px;
  border-radius: 4px;
  line-height: 1;
}
.input-password__toggle:hover { color: var(--text); }
.input-password__toggle svg { width: 18px; height: 18px; stroke-width: 1.8; }
.profile-section-sub { font-size: 0.9rem; margin: 20px 0 8px; color: var(--text-muted); letter-spacing: 0.04em; }
/* デスクトップではスタブ担当者ボタン非表示 */
.profile-sidebar__item--sub { display: none; }

@media (max-width: 720px) {
  .profile-layout { grid-template-columns: 1fr; gap: 16px; }
  .profile-sidebar {
    display: grid !important;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    position: static;
    flex-direction: unset;
    flex-wrap: unset;
  }
  .profile-sidebar__item {
    flex: unset !important;
    white-space: normal;
    justify-content: center;
    text-align: center;
    font-size: 0.85rem;
    padding: 10px 8px;
    flex-direction: column;
    gap: 4px;
    background: var(--surface-2);
    color: var(--text-muted);
  }
  .profile-sidebar__item--sub { display: flex; } /* スマホのみ表示 */
  .profile-sidebar__sub { display: none !important; }
}

/* === Minutes card list === */
.minutes-list { display: grid; gap: 12px; margin-top: 16px; }
.minutes-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  box-shadow: var(--shadow);
  color: var(--text);
  transition: box-shadow 0.15s;
}
.minutes-card--link:hover { text-decoration: none; color: var(--text); }
.minutes-card__info { flex: 1; min-width: 0; }
.minutes-card__title { font-weight: 600; font-size: 0.95rem; margin: 0 0 4px; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.minutes-card__meta { font-size: 0.8rem; color: var(--text-muted); display: flex; align-items: center; gap: 4px; flex-wrap: wrap; }
.minutes-card__meta svg { width: 12px; height: 12px; flex-shrink: 0; }
.minutes-card__right { align-items: center; }
.minutes-card__date { white-space: nowrap; text-align: right; }
.minutes-project-tags { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 0; }
.tag--project { display: inline-flex; align-items: center; gap: 4px; padding: 3px 8px; border-radius: 999px; background: var(--primary-soft); color: var(--primary); font-size: 0.75rem; font-weight: 600; text-decoration: none; transition: background 0.15s; }
.tag--project:hover { background: var(--primary); color: #fff; }
.tag--project svg { width: 11px; height: 11px; }
.minutes-list--compact { display: flex; flex-direction: column; gap: 8px; }
.minutes-card--link { cursor: pointer; text-decoration: none; }
.checkbox-group { display: flex; flex-direction: column; gap: 8px; }
.checkbox-label { display: flex; align-items: center; gap: 8px; font-size: 0.9rem; cursor: pointer; }
.minutes-unread-badge { font-size: 0.65rem; padding: 1px 6px; line-height: 1.6; }
.minutes-body { line-height: 1.85; font-size: 0.95rem; }
.minutes-body h2 { font-size: 1.05rem; font-weight: 700; margin: 24px 0 10px; padding-bottom: 6px; border-bottom: 1px solid var(--line); }
.minutes-body h3 { font-size: 0.95rem; font-weight: 700; margin: 16px 0 8px; }
.minutes-body p { margin: 0 0 10px; }
.minutes-body ul, .minutes-body ol { padding-left: 20px; margin: 0 0 10px; }
.minutes-body li { margin-bottom: 4px; }
.minutes-body hr { border: none; border-top: 1px solid var(--line); margin: 20px 0; }
.minutes-body strong { font-weight: 700; }
.minutes-body table { border-collapse: collapse; width: 100%; margin: 0 0 12px; font-size: 0.9rem; }
.minutes-body th, .minutes-body td { border: 1px solid var(--line); padding: 6px 12px; text-align: left; }
.minutes-body th { background: var(--surface); font-weight: 600; }
.minutes-body a { color: var(--primary); text-decoration: underline; word-break: break-all; }
.minutes-edit-textarea { min-height: 320px; font-family: inherit; line-height: 1.7; }

/* === Requests === */
/* === Action banners === */
.action-banners { display: grid; gap: 8px; }
.action-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 16px;
  border-radius: var(--radius);
  font-size: 0.875rem;
  font-weight: 500;
}
.action-banner > span { flex: 1; }
.action-banner svg { width: 18px; height: 18px; flex-shrink: 0; }
.action-banner--info   { background: var(--accent-soft); color: var(--accent); }
.action-banner--warn   { background: var(--warn-soft);   color: var(--warn); }
.action-banner--danger { background: var(--danger-soft); color: var(--danger); }
.action-banner__btn {
  display: inline-flex;
  align-items: center;
  gap: 3px;
  font-size: 0.8rem;
  font-weight: 600;
  white-space: nowrap;
  padding: 5px 12px;
  border-radius: 6px;
  border: 1.5px solid currentColor;
  color: inherit;
  opacity: 0.85;
}
.action-banner__btn:hover { opacity: 1; color: inherit; }
.action-banner__btn svg { width: 13px; height: 13px; }
@media (max-width: 880px) {
  .action-banner { flex-wrap: wrap; }
  .action-banner > span { flex-basis: calc(100% - 30px); }
  .action-banner__btn { margin-left: auto; }
}

.request-new-form {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px 24px;
  margin-top: 16px;
  box-shadow: var(--shadow);
}
.form-section-title {
  font-size: 1rem;
  font-weight: 600;
  margin: 0 0 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}
.form-section-title svg { width: 18px; height: 18px; color: var(--primary); }
.form-grid-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}
.inline-form { display: inline; }
.section-heading { font-size: 1rem; font-weight: 600; margin: 0 0 4px; color: var(--text); }
.dash-section-head { display: flex; align-items: baseline; justify-content: space-between; }
.dash-section-head h2 { font-size: 1.3rem; margin: 0; display: inline-flex; align-items: center; gap: 8px; }
.dash-section-head h2 .nav-badge { vertical-align: middle; }
.danger-zone { padding-top: 16px; border-top: 1px solid var(--line); }

/* === Standalone input/label (request form etc.) === */
.form-label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 6px;
  letter-spacing: 0.01em;
}
.required { color: var(--danger); font-size: 0.75em; margin-left: 2px; }
.input {
  width: 100%;
  background: #fff;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 11px 14px;
  color: var(--text);
  font-family: inherit;
  font-size: 0.95rem;
  transition: border-color 0.15s, box-shadow 0.15s;
  display: block;
}
.input:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(255, 90, 54, 0.12);
}
textarea.input { resize: vertical; min-height: 100px; }
.input--sm {
  padding: 5px 10px;
  font-size: 0.82rem;
  border-radius: 7px;
  border: 1px solid var(--line-strong);
  background: #fff;
  color: var(--text);
  font-family: inherit;
  cursor: pointer;
}
/* フォームのrow = ラベル+input の縦並び */
.request-new-form .form-row,
.minutes-edit-form .form-row {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

@media (max-width: 640px) {
  .form-grid-2 { grid-template-columns: 1fr; }
  .minutes-card { flex-direction: column; align-items: flex-start; }
  .minutes-card .flex-row-gap { width: 100%; justify-content: flex-end; }
}

/* ── スクロールプログレスバー ── */
.scroll-progress {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: rgba(0, 0, 0, 0.08);
  z-index: 950;
  pointer-events: none;
}
.scroll-progress__bar {
  height: 100%;
  background: var(--primary);
  width: 0%;
  transition: width 0.1s linear;
}

/* ── 右端固定お問い合わせボタン ── */
.float-contact {
  position: fixed;
  right: 0;
  top: 50%;
  transform: translateY(-50%);
  writing-mode: vertical-rl;
  background: var(--primary);
  color: #fff;
  padding: 16px 10px;
  border-radius: 4px 0 0 4px;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-decoration: none;
  z-index: 950;
  box-shadow: -2px 0 12px rgba(0, 0, 0, 0.12);
  transition: background 0.2s;
  display: flex;
  flex-direction: row;
  align-items: center;
  gap: 6px;
}
.float-contact:hover { background: rgba(255, 90, 54, 0.72); color: #fff; }
.float-contact i,
.float-contact i svg { width: 13px !important; height: 13px !important; }
@media (max-width: 880px) {
  .float-contact { display: none; }
  .scroll-progress { bottom: 0; z-index: 1001; }
  .site-footer { display: none; }
}

/* ===== SP nav footer ===== */
.sp-nav-footer { display: none; }
@media (max-width: 880px) {
  .sp-nav-footer {
    display: block;
    margin-top: auto;
    padding-top: 20px;
    border-top: 1px solid var(--line);
  }
  .sp-nav-footer__brand { padding: 0 8px 12px; }
  .sp-nav-footer__brand-name {
    display: block;
    font-weight: 700;
    font-size: 0.95rem;
    color: var(--text);
    margin-bottom: 2px;
  }
  .sp-nav-footer__tagline {
    font-size: 0.75rem;
    color: var(--text-muted);
  }
  .sp-nav-footer__links {
    display: flex;
    flex-direction: column;
    border-top: 1px solid var(--line);
    padding-top: 8px;
    margin-top: 8px;
  }
  .sp-nav-footer__links a {
    font-size: 0.82rem !important;
    font-weight: 500 !important;
    color: var(--text-muted) !important;
    padding: 9px 8px !important;
    opacity: 1 !important;
    letter-spacing: 0 !important;
  }
  .sp-nav-footer__links a:hover { color: var(--text) !important; }
  .sp-nav-footer__copy {
    font-size: 0.72rem;
    color: var(--text-muted);
    padding: 10px 8px 0;
  }
}

/* ===== Login Modal ===== */
.login-modal-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 40, 0.55);
  backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  z-index: 1100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  transition: opacity 0.22s ease;
}
.login-modal-backdrop[hidden] { display: none; }
.login-modal-backdrop.is-open { opacity: 1; }

.login-modal {
  background: #fff;
  border-radius: 18px;
  padding: 40px 36px 36px;
  width: 100%;
  max-width: 400px;
  position: relative;
  transform: translateY(16px) scale(0.98);
  transition: transform 0.22s ease;
  box-shadow: 0 24px 60px rgba(0,0,0,0.18);
}
.login-modal-backdrop.is-open .login-modal {
  transform: translateY(0) scale(1);
}

.login-modal__close {
  position: absolute;
  top: 14px;
  right: 14px;
  background: none;
  border: none;
  cursor: pointer;
  color: var(--text-muted);
  padding: 6px;
  border-radius: 6px;
  line-height: 1;
  transition: color 0.15s, background 0.15s;
}
.login-modal__close:hover { color: var(--text); background: var(--bg-2); }

.login-modal__icon {
  width: 48px;
  height: 48px;
  background: linear-gradient(135deg, var(--primary), #ff8a65);
  border-radius: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 16px;
  color: #fff;
}
.login-modal__icon svg { width: 22px; height: 22px; }

.login-modal__title {
  text-align: center;
  font-size: 1.2rem;
  margin: 0 0 4px;
}
.login-modal__sub {
  text-align: center;
  color: var(--text-muted);
  font-size: 0.83rem;
  margin: 0 0 20px;
}
.login-modal__error {
  background: #fee2e2;
  color: #b91c1c;
  padding: 10px 14px;
  border-radius: 8px;
  font-size: 0.875rem;
  margin-bottom: 16px;
}
.login-modal__hint {
  margin: 12px 0 0;
}
.login-modal .btn--lg { width: 100%; margin-top: 4px; }

@media (max-width: 480px) {
  .login-modal { padding: 32px 20px 24px; border-radius: 14px; }
}
