/* styles.css — 経費精算ヒカリ (design v2) */

/* ------------------------------------------------------------------ */
/* CSS Custom Properties                                                */
/* ------------------------------------------------------------------ */
:root {
  --sidebar-bg:     #0D5C73;
  --sidebar-active: #0A8C9E;
  --sidebar-hover:  rgba(255,255,255,.08);
  --sidebar-text:   rgba(255,255,255,.72);
  --sidebar-text-active: #ffffff;

  --primary: #0A8C9E;
  --primary-hover: #0B7C8C;
  --accent:  #00D4C8;
  --bg:      #E6F7F8;
  --white:   #ffffff;
  --dark:    #0D5C73;

  --text:    #0D1B2A;
  --text-secondary: #5B7A82;
  --border:  #D8ECEF;

  --amber:      #C7860B;
  --amber-bg:   #FBECD1;
  --green:      #1F8A5F;
  --green-bg:   #DFF3E9;
  --rose:       #C1435E;
  --rose-bg:    #FBE3E9;
  --gray:       #64748B;
  --gray-bg:    #EEF2F3;

  --shadow:    0 1px 3px rgba(13,43,62,.07), 0 1px 2px rgba(13,43,62,.04);
  --shadow-md: 0 4px 10px -2px rgba(13,43,62,.10);
  --shadow-lg: 0 16px 32px -8px rgba(13,43,62,.20);
  --radius:    16px;
  --radius-sm: 10px;
  --sidebar-width: 252px;
  --header-height: 60px;

  --ease-out: cubic-bezier(.22,1,.36,1);
  --dur-fast:   180ms;  /* micro-interactions: hover/click feedback — stays snappy */
  --dur-base:   480ms;  /* page transitions, nav pill slide */
  --dur-reveal: 750ms;  /* card/table entrance fade-up */
  --dur-slow:   4000ms; /* donut reveal, bar growth — the drawing itself is the show */
}

/* ------------------------------------------------------------------ */
/* Motion — keyframes & reduced-motion guard                           */
/* ------------------------------------------------------------------ */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes contentEnter {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes tilePop {
  0%   { transform: scale(1); }
  40%  { transform: scale(1.07); }
  100% { transform: scale(1); }
}
@keyframes flashHighlight {
  0%   { background: rgba(0,212,200,.16); }
  100% { background: transparent; }
}
@keyframes loginOrbDrift {
  0%   { transform: translate(0,0) scale(1); }
  50%  { transform: translate(2%,-3%) scale(1.06); }
  100% { transform: translate(0,0) scale(1); }
}

.reveal-item {
  opacity: 0;
  transform: translateY(18px);
  animation: fadeUp var(--dur-reveal) var(--ease-out) forwards;
}

.content-enter {
  animation: contentEnter var(--dur-base) var(--ease-out);
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ------------------------------------------------------------------ */
/* Fonts — self-hosted, subset (外部CDN不使用)                           */
/* Noto Sans JP: JIS第1水準漢字(2965字)+かな+記号のみに絞って軽量化。      */
/* Inter: 金額表示専用。数字・記号のみのサブセットで tabular-nums に対応。  */
/* ------------------------------------------------------------------ */
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/NotoSansJP-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/NotoSansJP-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Noto Sans JP';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/NotoSansJP-700.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('/fonts/Inter-400.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url('/fonts/Inter-500.woff2') format('woff2');
}
@font-face {
  font-family: 'Inter';
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url('/fonts/Inter-700.woff2') format('woff2');
}

/* ------------------------------------------------------------------ */
/* Reset & Base                                                         */
/* ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  height: 100%;
  font-family: 'Noto Sans JP', system-ui, -apple-system, sans-serif;
  font-size: 14px;
  line-height: 1.75;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

/* 金額専用書体：数字が締まって見えるInterを桁ブレしないtabular-numsで適用 */
.amount-cell, .summary-value, .legend-amount, .donut-center-value,
.preview-value.big, .detail-value.amount, .plan-card-price,
.bar-label, .chart-amount-label {
  font-family: 'Inter', 'Noto Sans JP', system-ui, sans-serif;
  font-variant-numeric: tabular-nums;
  font-feature-settings: 'tnum' 1;
}

a { color: inherit; text-decoration: none; }
button { cursor: pointer; font-family: inherit; }
input, select, textarea { font-family: inherit; }

/* ------------------------------------------------------------------ */
/* Layout                                                               */
/* ------------------------------------------------------------------ */
#app { display: flex; height: 100vh; overflow: hidden; }

/* Sidebar */
.sidebar {
  width: var(--sidebar-width);
  min-width: var(--sidebar-width);
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  height: 100vh;
  overflow-y: auto;
  z-index: 200;
  position: relative;
  transition: transform .25s ease;
}

.ambient-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 22px 20px;
  position: relative;
  z-index: 1;
}

.sidebar-logo img {
  width: 30px;
  height: 30px;
  object-fit: contain;
  flex-shrink: 0;
}

.sidebar-logo-text {
  font-size: 15px;
  font-weight: 700;
  color: #fff;
  line-height: 1.3;
  letter-spacing: .01em;
}

.sidebar-nav { flex: 1; padding: 8px 12px; display: flex; flex-direction: column; gap: 2px; position: relative; z-index: 1; }

.nav-active-pill {
  position: absolute;
  left: 12px; right: 12px;
  top: 8px;
  height: 42px;
  background: var(--sidebar-active);
  border-radius: var(--radius-sm);
  box-shadow: 0 4px 10px -2px rgba(0,0,0,.25);
  transition: transform var(--dur-base) var(--ease-out), height var(--dur-base) var(--ease-out), opacity var(--dur-fast) ease;
  z-index: 0;
  opacity: 0;
  pointer-events: none;
}

.nav-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 14px;
  color: var(--sidebar-text);
  font-size: 13.5px;
  font-weight: 500;
  border-radius: var(--radius-sm);
  transition: background .15s, color .15s;
  cursor: pointer;
  position: relative;
  z-index: 1;
}

.nav-item:hover { background: var(--sidebar-hover); color: #fff; }
.nav-item.active {
  color: var(--sidebar-text-active);
}

.nav-item .nav-icon {
  width: 18px; height: 18px;
  opacity: .85;
  flex-shrink: 0;
  transition: opacity .15s;
}
.nav-item.active .nav-icon { opacity: 1; }

/* Sidebar user block (bottom) */
.sidebar-user {
  margin: 8px;
  padding: 10px;
  border-top: 1px solid rgba(255,255,255,.10);
  position: relative;
  z-index: 1;
}

.sidebar-user-btn {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  background: none;
  border: none;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background .15s;
  margin-top: 8px;
}
.sidebar-user-btn:hover { background: var(--sidebar-hover); }

.sidebar-user-info { flex: 1; min-width: 0; text-align: left; }
.sidebar-user-name { font-size: 13px; font-weight: 600; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-sub { font-size: 11px; color: rgba(255,255,255,.5); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sidebar-user-btn .chev { color: rgba(255,255,255,.5); flex-shrink: 0; transition: transform .15s; }
.sidebar-user-btn.open .chev { transform: rotate(180deg); }

.sidebar-user-dropdown {
  display: none;
  position: absolute;
  left: 8px; right: 8px;
  bottom: calc(100% + 6px);
  background: var(--white);
  border-radius: var(--radius-sm);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  z-index: 500;
}
.sidebar-user-dropdown.open { display: block; }

.sidebar-user-dropdown .dropdown-header {
  padding: 10px 14px;
  font-size: 11px;
  color: var(--text-secondary);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .06em;
  border-bottom: 1px solid var(--border);
}

.user-switcher-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  cursor: pointer;
  transition: background .12s;
}
.user-switcher-item:hover { background: var(--bg); }
.user-switcher-item.current { background: #eefaf9; }
.user-switcher-item .item-info { flex: 1; min-width: 0; }
.user-switcher-item .item-name { font-size: 13px; font-weight: 500; color: var(--text); }
.user-switcher-item .item-role { font-size: 11px; color: var(--text-secondary); }

.sidebar-logout {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 10px 14px;
  border: none;
  border-top: 1px solid var(--border);
  background: none;
  font-size: 12.5px;
  color: var(--rose);
  transition: background .12s;
}
.sidebar-logout:hover { background: var(--rose-bg); }

/* Avatar (person silhouette) */
.avatar-circle {
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  color: #fff;
}
.avatar-circle svg { width: 60%; height: 60%; }

/* Mobile top bar */
.mobile-topbar {
  display: none;
  align-items: center;
  gap: 12px;
  height: var(--header-height);
  min-height: var(--header-height);
  padding: 0 16px;
  background: var(--white);
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
  position: relative;
  z-index: 1;
}
.header-menu-btn {
  display: flex;
  background: none;
  border: none;
  padding: 6px;
  border-radius: 6px;
  color: var(--text-secondary);
}
.header-menu-btn:hover { background: var(--bg); }
.mobile-topbar-title { font-size: 15px; font-weight: 700; color: var(--text); }

/* Main area */
.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  position: relative;
  background: var(--bg);
}

/* Content */
.content {
  flex: 1;
  overflow-y: auto;
  padding: 32px 36px;
  position: relative;
  z-index: 1;
}

/* Mobile overlay */
.sidebar-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.5);
  z-index: 199;
}
.sidebar-overlay.open { display: block; }

/* ------------------------------------------------------------------ */
/* Login Page — "profile select" entrance, glassmorphism over the       */
/* ambient light canvas (same brand feel as the rest of the app)        */
/* ------------------------------------------------------------------ */
.login-page {
  position: relative;
  width: 100%;
  height: 100vh;
  overflow: hidden;
  background: var(--sidebar-bg);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px;
}

.login-bg-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
}

.login-v2-content {
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
  max-width: 880px;
}

.login-v2-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 6px;
}
.login-v2-header img { width: 34px; height: 34px; object-fit: contain; }
.login-v2-title {
  font-size: 22px;
  font-weight: 700;
  color: #fff;
  letter-spacing: .02em;
}

.login-v2-subtitle {
  font-size: 13.5px;
  color: rgba(255,255,255,.65);
  margin-bottom: 40px;
}

.login-v2-grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 22px;
  width: 100%;
}

.profile-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  width: 168px;
  padding: 28px 16px 22px;
  border-radius: 22px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
  cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out), background var(--dur-fast) ease;
}
.profile-card:hover, .profile-card:focus-visible {
  transform: translateY(-6px);
  background: rgba(255,255,255,.22);
  box-shadow: 0 16px 32px rgba(0,0,0,.24);
}
.profile-card:hover .profile-avatar { transform: scale(1.08); }
.profile-card.selecting {
  background: rgba(255,255,255,.34);
  transform: translateY(-6px) scale(1.04);
  box-shadow: 0 0 0 3px rgba(0,212,200,.55), 0 16px 32px rgba(0,0,0,.24);
}

.profile-avatar {
  width: 76px; height: 76px;
  border-radius: 50%;
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 26px; font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 14px rgba(0,0,0,.22), inset 0 0 0 2px rgba(255,255,255,.25);
  transition: transform var(--dur-fast) var(--ease-out);
}

.profile-name {
  font-size: 14.5px;
  font-weight: 600;
  color: #fff;
  text-align: center;
}

.profile-role-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 11px;
  border-radius: 20px;
  background: rgba(255,255,255,.85);
  color: var(--sidebar-bg);
}

.login-v2-footer {
  position: relative;
  z-index: 1;
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,.55);
  margin-top: 44px;
}
.login-v2-footer a { color: rgba(255,255,255,.85); }
.login-v2-footer a:hover { text-decoration: underline; }

/* Auth forms (login/signup/invite-accept) — same glassmorphism world as the profile cards */
.auth-card {
  width: 100%;
  max-width: 400px;
  padding: 36px 32px;
  border-radius: 24px;
  background: rgba(255,255,255,.14);
  border: 1px solid rgba(255,255,255,.22);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  box-shadow: 0 8px 24px rgba(0,0,0,.18);
}
.auth-card .form-label { color: rgba(255,255,255,.85); }
.auth-card .form-control {
  background: rgba(255,255,255,.92);
  border: 1px solid rgba(255,255,255,.3);
}
.auth-card-title { font-size: 18px; font-weight: 700; color: #fff; letter-spacing: 0.012em; margin-bottom: 4px; text-align: center; }
.auth-card-sub { font-size: 12.5px; color: rgba(255,255,255,.65); text-align: center; margin-bottom: 24px; }
.auth-divider {
  display: flex; align-items: center; gap: 12px;
  margin: 18px 0; color: rgba(255,255,255,.5); font-size: 12px;
}
.auth-divider::before, .auth-divider::after { content: ''; flex: 1; height: 1px; background: rgba(255,255,255,.2); }
.btn-google {
  display: flex; align-items: center; justify-content: center; gap: 10px;
  width: 100%; padding: 11px; border-radius: 9px;
  background: #fff; color: #3c4043; font-weight: 600; font-size: 13.5px;
  border: 1px solid rgba(0,0,0,.1);
}
.btn-google:hover { background: #f7f7f7; }
.auth-footer-link { text-align: center; margin-top: 18px; font-size: 12.5px; color: rgba(255,255,255,.7); }
.auth-footer-link a { color: #fff; font-weight: 600; text-decoration: underline; }
.auth-error { background: rgba(193,67,94,.18); border: 1px solid rgba(193,67,94,.4); color: #fff; border-radius: 8px; padding: 10px 12px; font-size: 12.5px; margin-bottom: 16px; }

/* ------------------------------------------------------------------ */
/* Cards & Summaries                                                    */
/* ------------------------------------------------------------------ */
.card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 24px;
}

.summary-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 20px;
}

.summary-card {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px 22px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.summary-card:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); }

.summary-card-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.summary-label {
  font-size: 12.5px;
  color: var(--text-secondary);
  font-weight: 500;
}

.summary-icon { width: 40px; height: 40px; object-fit: contain; flex-shrink: 0; }

.summary-value {
  font-size: 28px;
  font-weight: 700;
  color: var(--text);
  font-variant-numeric: tabular-nums;
  line-height: 1.1;
}
.summary-value .unit { font-size: 15px; font-weight: 600; margin-left: 2px; }
.summary-value.c-amber  { color: var(--amber); }
.summary-value.c-green  { color: var(--green); }
.summary-value.c-rose   { color: var(--rose); }

/* ------------------------------------------------------------------ */
/* Graphs (SVG)                                                         */
/* ------------------------------------------------------------------ */
.charts-grid {
  display: grid;
  grid-template-columns: 1fr 1.4fr;
  gap: 16px;
  margin-bottom: 20px;
}

.chart-card {
  background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); padding: 24px;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.chart-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-md); }
.chart-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 18px; }

/* Bar/donut entrance animation hooks (classes toggled via JS) */
.bar-rect { transition: height var(--dur-slow) var(--ease-out), y var(--dur-slow) var(--ease-out); }
/* Donut segments now draw themselves (see .donut-arc, clockwise from 12
   o'clock, accumulating one at a time) — the wrap just needs a quick,
   subtle settle-in so the center total label doesn't pop in abruptly. */
.donut-reveal {
  transition: opacity var(--dur-base) ease, transform var(--dur-base) var(--ease-out);
  opacity: 0;
  transform: scale(.94);
}
.donut-reveal.in { opacity: 1; transform: scale(1); }
.donut-arc { stroke-dasharray: 0 1000; }

.donut-wrap {
  display: flex;
  align-items: center;
  gap: 22px;
  flex-wrap: wrap;
}

.donut-svg-wrap { position: relative; flex-shrink: 0; display: flex; align-items: center; justify-content: center; }
.donut-center {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%,-50%);
  text-align: center;
  pointer-events: none;
}
.donut-center-label { font-size: 10.5px; color: var(--text-secondary); }
.donut-center-value { font-size: 15px; font-weight: 700; color: var(--text); }

.donut-legend {
  flex: 1;
  min-width: 160px;
  display: flex;
  flex-direction: column;
  gap: 11px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
}

.legend-dot {
  width: 9px; height: 9px;
  border-radius: 50%;
  flex-shrink: 0;
}

.legend-icon {
  width: 16px; height: 16px;
  object-fit: contain;
  flex-shrink: 0;
}

.legend-name { flex: 1; color: var(--text); }
.legend-amount { color: var(--text); font-weight: 600; font-variant-numeric: tabular-nums; margin-right: 8px; }
.legend-pct { color: var(--text-secondary); font-variant-numeric: tabular-nums; min-width: 34px; text-align: right; }

.bar-chart-wrap { width: 100%; overflow-x: auto; }
.bar-chart-svg, .hbar-chart-svg { display: block; }

/* ------------------------------------------------------------------ */
/* Tables                                                               */
/* ------------------------------------------------------------------ */
.table-wrap { overflow-x: auto; }

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13px;
}

th {
  text-align: left;
  font-size: 11px;
  font-weight: 600;
  color: var(--text-secondary);
  padding: 10px 12px;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
}

td {
  padding: 13px 12px;
  border-bottom: 1px solid #eef5f6;
  color: var(--text);
  vertical-align: middle;
}

tr:last-child td { border-bottom: none; }
tr.clickable:hover td { background: #f5fbfb; cursor: pointer; }
tr.row-pending td { background: #fdf8ee; }
tr.row-pending:hover td { background: #fbf2dd; }

.cell-user { display: flex; align-items: center; gap: 8px; }
.cell-cat { display: flex; align-items: center; gap: 6px; }
.cell-cat img { width: 18px; height: 18px; object-fit: contain; }

.amount-cell {
  font-variant-numeric: tabular-nums;
  font-weight: 600;
  text-align: right;
  white-space: nowrap;
}

.row-actions { display: flex; gap: 6px; white-space: nowrap; }

/* ------------------------------------------------------------------ */
/* Status Badges                                                        */
/* ------------------------------------------------------------------ */
.badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 11px;
  border-radius: 20px;
  font-size: 11.5px;
  font-weight: 600;
  white-space: nowrap;
}

.badge-draft    { background: var(--gray-bg);  color: var(--gray); }
.badge-pending  { background: var(--amber-bg); color: var(--amber); }
.badge-approved { background: var(--green-bg); color: var(--green); }
.badge-rejected { background: var(--rose-bg);  color: var(--rose); }

/* ------------------------------------------------------------------ */
/* Buttons                                                              */
/* ------------------------------------------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 9px 18px;
  border-radius: 9px;
  font-size: 13px;
  font-weight: 600;
  border: none;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, color var(--dur-fast) ease, transform 90ms ease;
  white-space: nowrap;
}
.btn:active { transform: scale(.96); }

.btn-primary {
  background: var(--accent);
  color: #063d3a;
}
.btn-primary:hover { background: #05c0b5; }

.btn-secondary {
  background: var(--bg);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover { background: #dcf2f3; border-color: var(--primary); }

.btn-outline {
  background: transparent;
  color: var(--primary);
  border: 1.5px solid var(--primary);
}
.btn-outline:hover { background: rgba(10,140,158,.08); }

.btn-approve {
  background: var(--green-bg);
  color: var(--green);
  border: 1px solid transparent;
}
.btn-approve:hover { background: #cdedd9; }

.btn-reject {
  background: var(--rose-bg);
  color: var(--rose);
  border: 1px solid transparent;
}
.btn-reject:hover { background: #f7cdd6; }

.btn-danger {
  background: var(--rose-bg);
  color: var(--rose);
  border: none;
}
.btn-danger:hover { background: #f7cdd6; }

.btn-sm { padding: 5px 13px; font-size: 12px; }
.btn-icon { padding: 7px; border-radius: 7px; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }

.btn-block { width: 100%; padding: 15px; font-size: 15px; border-radius: 12px; }

/* ------------------------------------------------------------------ */
/* Date / month pill selector                                          */
/* ------------------------------------------------------------------ */
.pill-select-wrap {
  position: relative;
  display: inline-flex;
  align-items: center;
}
.pill-select-wrap svg.pill-icon {
  position: absolute; left: 12px; pointer-events: none; color: var(--text-secondary);
}
.pill-select {
  appearance: none;
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 8px 30px 8px 34px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  box-shadow: var(--shadow);
  outline: none;
}
.pill-select-wrap svg.pill-chev {
  position: absolute; right: 12px; pointer-events: none; color: var(--text-secondary);
}

/* ------------------------------------------------------------------ */
/* Forms                                                                */
/* ------------------------------------------------------------------ */
.form-group { margin-bottom: 20px; }
.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  margin-bottom: 8px;
}

.form-control {
  width: 100%;
  padding: 10px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 14px;
  color: var(--text);
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
  outline: none;
}
.form-control:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(10,140,158,.12);
}

select.form-control { appearance: none; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='7'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%235B7A82' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E"); background-repeat: no-repeat; background-position: right 12px center; padding-right: 32px; }

textarea.form-control { min-height: 90px; resize: vertical; }

.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }

.char-counter { text-align: right; font-size: 11px; color: var(--text-secondary); margin-top: 4px; }

/* Big amount input */
.amount-input-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 1.5px solid var(--border);
  border-radius: 12px;
  padding: 10px 18px;
  background: var(--white);
  transition: border-color .15s, box-shadow .15s;
}
.amount-input-wrap:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(10,140,158,.12); }
.amount-input-wrap .yen-sign { font-size: 26px; font-weight: 700; color: var(--text-secondary); }
.amount-input-wrap input {
  border: none; outline: none; flex: 1; font-size: 32px; font-weight: 700; color: var(--text);
  font-variant-numeric: tabular-nums; background: transparent; min-width: 0;
}

/* Category selector (tile grid) */
.cat-select-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}

.cat-select-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 16px 8px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all .15s;
  font-size: 12px;
  font-weight: 500;
  text-align: center;
  color: var(--text);
  position: relative;
}
.cat-select-item:hover { border-color: var(--primary); background: #f0fafb; }
.cat-select-item.selected {
  border-color: var(--primary);
  background: #eaf8f9;
}
.cat-select-item.selected::after {
  content: '';
  position: absolute;
  top: 10px; right: 10px;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px #fff;
}
.cat-select-item.pop { animation: tilePop 320ms var(--ease-out); }
.cat-select-item img { width: 32px; height: 32px; object-fit: contain; }

/* Receipt upload */
.receipt-upload-area {
  border: 2px dashed var(--border);
  border-radius: var(--radius-sm);
  padding: 28px;
  text-align: center;
  cursor: pointer;
  transition: all .15s;
  position: relative;
}
.receipt-upload-area:hover { border-color: var(--primary); background: #f0fafb; }
.receipt-upload-area.has-file { border-color: var(--primary); background: #f0fafb; }
.receipt-upload-area input[type=file] { display: none; }

.receipt-preview {
  max-width: 100%;
  max-height: 200px;
  border-radius: 8px;
  object-fit: contain;
  margin-top: 12px;
}

.upload-hint { font-size: 12.5px; color: var(--text-secondary); margin-top: 10px; line-height: 1.7; }
.upload-hint-sub { font-size: 11px; color: var(--text-secondary); opacity: .8; }

/* New-expense two-column layout + preview panel */
.new-expense-grid {
  display: grid;
  grid-template-columns: 1fr 340px;
  gap: 20px;
  align-items: start;
}

.preview-card { display: flex; flex-direction: column; gap: 4px; }
.preview-title { font-size: 14px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.preview-row {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 13px 0;
  border-bottom: 1px solid var(--border);
  border-radius: 6px;
  transition: background 700ms ease;
}
.preview-row:last-child { border-bottom: none; }
.preview-row.flash { animation: flashHighlight 700ms ease; }
.preview-icon {
  width: 34px; height: 34px;
  border-radius: 50%;
  background: var(--bg);
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
  color: var(--primary);
}
.preview-icon img { width: 18px; height: 18px; object-fit: contain; }
.preview-body { flex: 1; min-width: 0; }
.preview-label { font-size: 11.5px; color: var(--text-secondary); margin-bottom: 2px; }
.preview-value { font-size: 14px; color: var(--text); font-weight: 500; word-break: break-word; }
.preview-value.big { font-size: 22px; font-weight: 700; }
.preview-value.muted { color: var(--text-secondary); font-weight: 400; }

/* ------------------------------------------------------------------ */
/* Modals                                                               */
/* ------------------------------------------------------------------ */
.modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(13,43,62,.45);
  z-index: 1000;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: var(--white);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 600px;
  max-height: 90vh;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
}

.modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 16px;
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--white);
  z-index: 1;
}

.modal-title { font-size: 16px; font-weight: 700; color: var(--text); letter-spacing: 0.012em; }

.modal-close {
  background: none;
  border: none;
  color: var(--text-secondary);
  font-size: 22px;
  line-height: 1;
  padding: 4px 6px;
  border-radius: 6px;
  transition: all .12s;
}
.modal-close:hover { background: var(--bg); color: var(--text); }

.modal-body { padding: 24px; flex: 1; }

.modal-footer {
  padding: 16px 24px;
  border-top: 1px solid var(--border);
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  position: sticky;
  bottom: 0;
  background: var(--white);
}

/* Detail grid */
.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.detail-item { display: flex; flex-direction: column; gap: 4px; }
.detail-item.full { grid-column: 1 / -1; }
.detail-label { font-size: 11px; font-weight: 600; color: var(--text-secondary); }
.detail-value { font-size: 14px; color: var(--text); }
.detail-value.amount { font-size: 20px; font-weight: 700; font-variant-numeric: tabular-nums; color: var(--text); }

/* ------------------------------------------------------------------ */
/* Filters & Search                                                     */
/* ------------------------------------------------------------------ */
.filter-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tabs {
  display: flex;
  gap: 4px;
  background: var(--bg);
  padding: 4px;
  border-radius: 10px;
}

.filter-tab {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all .15s;
  border: none;
  background: none;
}
.filter-tab.active {
  background: var(--white);
  color: var(--primary);
  box-shadow: var(--shadow);
}
.filter-tab .count-badge {
  background: var(--amber-bg);
  color: var(--amber);
  border-radius: 10px;
  padding: 1px 7px;
  font-size: 11px;
  font-weight: 700;
}

.search-input-wrap {
  position: relative;
  flex: 1;
  min-width: 200px;
}
.search-input-wrap svg {
  position: absolute;
  left: 12px; top: 50%;
  transform: translateY(-50%);
  color: var(--text-secondary);
}
.search-input {
  width: 100%;
  padding: 9px 12px 9px 36px;
  border: 1.5px solid var(--border);
  border-radius: 10px;
  font-size: 13px;
  outline: none;
  background: var(--white);
  transition: border-color .15s;
}
.search-input:focus { border-color: var(--primary); }

/* Pagination */
.pagination-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 16px;
  flex-wrap: wrap;
  gap: 10px;
}
.pagination-info { font-size: 12.5px; color: var(--text-secondary); }
.pagination-pages { display: flex; align-items: center; gap: 4px; }
.page-btn {
  min-width: 30px;
  height: 30px;
  padding: 0 6px;
  border-radius: 7px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 600;
}
.page-btn:hover { background: var(--bg); }
.page-btn.active { background: var(--primary); color: #fff; }
.page-btn[disabled] { opacity: .35; cursor: not-allowed; }

/* ------------------------------------------------------------------ */
/* Empty State                                                          */
/* ------------------------------------------------------------------ */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 48px 24px;
  gap: 14px;
  text-align: center;
}
.empty-state img { width: 110px; height: 110px; object-fit: contain; }
.empty-state-title { font-size: 15px; font-weight: 600; color: var(--text); }
.empty-state-sub { font-size: 13px; color: var(--text-secondary); }

/* ------------------------------------------------------------------ */
/* Toast                                                                */
/* ------------------------------------------------------------------ */
.toast-container {
  position: fixed;
  bottom: 24px; right: 24px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 10px;
  pointer-events: none;
}

.toast {
  background: var(--sidebar-bg);
  color: #fff;
  padding: 12px 18px;
  border-radius: 10px;
  font-size: 13px;
  font-weight: 500;
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 10px;
  animation: toastIn .25s ease;
  max-width: 300px;
}

.toast.success { border-left: 4px solid var(--accent); }
.toast.error   { border-left: 4px solid #ef4444; }
.toast.info    { border-left: 4px solid var(--primary); }

@keyframes toastIn {
  from { opacity: 0; transform: translateY(12px); }
  to   { opacity: 1; transform: translateY(0); }
}

/* ------------------------------------------------------------------ */
/* Page-specific                                                        */
/* ------------------------------------------------------------------ */
.page-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}
.page-header-left { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }

.page-title { font-size: 24px; font-weight: 800; color: var(--text); letter-spacing: 0.015em; }
.page-sub { font-size: 13px; color: var(--text-secondary); margin-top: 2px; }

/* Reports */
.trend-icon-wrap {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  flex-shrink: 0;
}
.trend-icon-wrap.up { background: var(--green-bg); color: var(--green); }
.trend-icon-wrap.down { background: var(--rose-bg); color: var(--rose); }

.report-total {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 20px;
  background: var(--sidebar-bg);
  border-radius: var(--radius-sm);
  color: #fff;
  margin-top: 16px;
}

.report-total-label { font-size: 14px; font-weight: 600; }
.report-total-amount { font-size: 22px; font-weight: 700; font-variant-numeric: tabular-nums; }

/* Settings */
.settings-section { margin-bottom: 20px; }
.settings-section-title {
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.012em;
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--border);
}

.settings-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid #eef5f6;
}
.settings-item:last-child { border-bottom: none; }
.settings-item-info { flex: 1; }
.settings-item-name { font-size: 14px; font-weight: 500; }
.settings-item-sub { font-size: 12px; color: var(--text-secondary); }

.cat-icon-sm { width: 22px; height: 22px; object-fit: contain; }

/* Billing (Phase C) */
.usage-bar { width: 100%; height: 7px; border-radius: 4px; background: var(--border); overflow: hidden; }
.usage-bar-fill { height: 100%; border-radius: 4px; background: var(--primary); transition: width var(--dur-base) var(--ease-out); }
.plan-card {
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 14px;
  background: var(--white);
  transition: box-shadow var(--dur-fast) var(--ease-out);
}
.plan-card.current { background: var(--bg); }
.sq-card-container {
  background: var(--white);
  border: 1px solid var(--border);
  border-radius: 8px;
  padding: 12px 14px;
  min-height: 84px;
}
.btn-cycle-toggle {
  border: none;
  background: transparent;
  color: var(--text-secondary);
  font-size: 12.5px;
  font-weight: 600;
  padding: 7px 16px;
  border-radius: 999px;
  cursor: pointer;
  transition: background var(--dur-fast) var(--ease-out), color var(--dur-fast) var(--ease-out);
}
.btn-cycle-toggle.active { background: var(--white); color: var(--text); box-shadow: var(--shadow); }
@media (max-width: 720px) {
  .plan-card-grid { grid-template-columns: 1fr !important; }
}

/* Approval / comment box */
.comment-box {
  width: 100%;
  padding: 8px 12px;
  border: 1.5px solid var(--border);
  border-radius: 9px;
  font-size: 13px;
  min-height: 70px;
  resize: vertical;
  outline: none;
  font-family: inherit;
}
.comment-box:focus { border-color: var(--primary); }

/* Section title inside card */
.section-title {
  font-size: 14.5px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.012em;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.link-more {
  display: block;
  text-align: center;
  padding-top: 16px;
  color: var(--primary);
  font-size: 13px;
  font-weight: 600;
}
.link-more:hover { text-decoration: underline; }

/* ------------------------------------------------------------------ */
/* Responsive                                                           */
/* ------------------------------------------------------------------ */
@media (max-width: 1100px) {
  .summary-grid { grid-template-columns: repeat(2, 1fr); }
  .charts-grid { grid-template-columns: 1fr; }
  .new-expense-grid { grid-template-columns: 1fr; }
}

@media (max-width: 900px) {
  .sidebar {
    position: fixed;
    top: 0; left: 0; bottom: 0;
    transform: translateX(-100%);
  }
  .sidebar.open { transform: translateX(0); }

  .mobile-topbar { display: flex; }

  .content { padding: 20px 16px; }

  .form-row { grid-template-columns: 1fr; }
  .cat-select-grid { grid-template-columns: repeat(3, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
}

@media (max-width: 600px) {
  .summary-grid { grid-template-columns: 1fr 1fr; }
  .cat-select-grid { grid-template-columns: repeat(2, 1fr); }
  .filter-bar { flex-direction: column; align-items: stretch; }
  .page-header { flex-direction: column; align-items: stretch; }
  .page-header .btn { width: 100%; }

  .login-page { padding: 16px; }
  .login-v2-grid { gap: 14px; }
  .profile-card { width: 132px; padding: 20px 10px 16px; gap: 10px; border-radius: 18px; }
  .profile-avatar { width: 58px; height: 58px; font-size: 20px; }
  .profile-name { font-size: 13px; }
  .login-v2-title { font-size: 18px; }
  .login-v2-subtitle { margin-bottom: 28px; }
}

/* ------------------------------------------------------------------ */
/* Landing Page (Phase D)                                               */
/* ------------------------------------------------------------------ */
.lp-page {
  min-height: 100%;
  width: 100%;
  background: var(--bg);
  overflow-x: hidden;
  overflow-y: auto;
  height: 100vh;
}
.lp-header {
  position: sticky; top: 0; z-index: 50;
  display: flex; align-items: center; gap: 24px;
  height: 68px; padding: 0 32px;
  background: rgba(255,255,255,.85); backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.lp-header-logo { display: flex; align-items: center; gap: 8px; font-weight: 800; font-size: 18px; color: var(--text); text-decoration: none; white-space: nowrap; }
.lp-header-logo img { height: 28px; width: auto; }
.lp-header-nav { display: flex; gap: 26px; margin-left: 20px; font-size: 14px; font-weight: 500; color: var(--text-secondary); }
.lp-header-nav a { color: inherit; text-decoration: none; }
.lp-header-nav a:hover { color: var(--primary); }
.lp-header-right { margin-left: auto; display: flex; align-items: center; gap: 16px; }
.lp-login-link { font-size: 14px; font-weight: 600; color: var(--text); text-decoration: none; white-space: nowrap; }
.lp-cta-btn {
  background: var(--primary); color: #fff; font-weight: 700; font-size: 14px;
  padding: 10px 22px; border-radius: 999px; text-decoration: none; border: none; cursor: pointer;
  box-shadow: 0 6px 16px rgba(10,140,158,.28);
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.lp-cta-btn:hover { transform: translateY(-1px); box-shadow: 0 10px 22px rgba(10,140,158,.34); }

.lp-hero {
  position: relative;
  padding: 88px 32px 60px;
  text-align: center;
  overflow: hidden;
}
.lp-hero-glow {
  position: absolute; border-radius: 50%; filter: blur(60px); opacity: .35; pointer-events: none;
  animation: lpGlowDrift 10s ease-in-out infinite alternate;
}
.lp-hero-glow.a { width: 420px; height: 420px; background: var(--accent); top: -120px; left: -80px; }
.lp-hero-glow.b { width: 380px; height: 380px; background: var(--primary); top: 40px; right: -100px; animation-delay: -4s; }
@keyframes lpGlowDrift {
  from { transform: translate(0,0) scale(1); }
  to   { transform: translate(3%, 4%) scale(1.08); }
}
.lp-hero-inner { position: relative; z-index: 1; max-width: 780px; margin: 0 auto; }
.lp-hero-title { font-size: 46px; font-weight: 800; color: var(--text); line-height: 1.3; letter-spacing: 0.01em; }
.lp-hero-sub { margin-top: 18px; font-size: 15.5px; color: var(--text-secondary); line-height: 1.8; }
.lp-hero-cta-row { margin-top: 28px; display: flex; flex-direction: column; align-items: center; gap: 10px; }
.lp-hero-cta-hint { font-size: 12.5px; color: var(--text-secondary); }
.lp-hero-shot {
  margin: 48px auto 0; max-width: 900px;
  border-radius: var(--radius); box-shadow: var(--shadow-lg);
  transform: perspective(1400px) rotateX(3deg);
  overflow: hidden;
}
.lp-hero-shot img { width: 100%; display: block; }

.lp-section { padding: 72px 32px; max-width: 1080px; margin: 0 auto; }
.lp-section-title { font-size: 27px; font-weight: 800; color: var(--text); text-align: center; letter-spacing: 0.01em; margin-bottom: 40px; }
.lp-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.lp-card {
  background: var(--white); border-radius: var(--radius); padding: 26px 22px;
  box-shadow: var(--shadow); text-align: left;
}
.lp-card-icon { width: 48px; height: 48px; border-radius: 12px; background: var(--bg); display: flex; align-items: center; justify-content: center; margin-bottom: 14px; font-size: 20px; }
.lp-card-icon img { width: 30px; height: 30px; object-fit: contain; }
.lp-card-title { font-size: 15.5px; font-weight: 700; color: var(--text); margin-bottom: 8px; }
.lp-card-body { font-size: 13.5px; color: var(--text-secondary); line-height: 1.8; }

.lp-steps { display: flex; align-items: flex-start; gap: 0; }
.lp-step { flex: 1; text-align: center; padding: 0 12px; }
.lp-step-num {
  width: 36px; height: 36px; border-radius: 50%; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center; font-weight: 700; margin: 0 auto 14px;
}
.lp-step-title { font-size: 14.5px; font-weight: 700; color: var(--text); margin-bottom: 6px; }
.lp-step-body { font-size: 13px; color: var(--text-secondary); line-height: 1.7; }
.lp-step-arrow { flex: 0 0 auto; color: var(--border); font-size: 22px; padding-top: 8px; }

.lp-cycle-toggle { display: flex; justify-content: center; margin-bottom: 32px; }
.lp-pricing-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
.lp-plan-card {
  background: var(--white); border-radius: var(--radius); padding: 28px 24px;
  box-shadow: var(--shadow); border: 2px solid transparent; text-align: left;
  display: flex; flex-direction: column;
}
.lp-plan-card.featured { border-color: var(--primary); box-shadow: var(--shadow-md); }
.lp-plan-badge {
  align-self: flex-start; font-size: 11px; font-weight: 700; color: #fff; background: var(--primary);
  padding: 3px 10px; border-radius: 10px; margin-bottom: 10px;
}
.lp-plan-name { font-size: 16px; font-weight: 700; color: var(--text); }
.lp-plan-price { font-size: 30px; font-weight: 800; color: var(--text); margin: 10px 0 4px; }
.lp-plan-price .unit { font-size: 13px; font-weight: 400; color: var(--text-secondary); }
.lp-plan-note { font-size: 11.5px; color: var(--green); font-weight: 600; min-height: 16px; }
.lp-plan-feature-list { margin: 18px 0; font-size: 13px; color: var(--text-secondary); line-height: 2; flex: 1; }
.lp-plan-feature-list li { list-style: none; padding-left: 20px; position: relative; }
.lp-plan-feature-list li::before { content: '✓'; position: absolute; left: 0; color: var(--primary); font-weight: 700; }

.lp-faq-item { border-bottom: 1px solid var(--border); padding: 18px 0; }
.lp-faq-q {
  display: flex; justify-content: space-between; align-items: center; cursor: pointer;
  font-size: 14.5px; font-weight: 600; color: var(--text);
}
.lp-faq-q .chev { transition: transform var(--dur-fast) var(--ease-out); color: var(--text-secondary); }
.lp-faq-item.open .lp-faq-q .chev { transform: rotate(180deg); }
.lp-faq-a {
  font-size: 13.5px; color: var(--text-secondary); line-height: 1.8;
  max-height: 0; overflow: hidden; transition: max-height var(--dur-base) var(--ease-out);
}
.lp-faq-item.open .lp-faq-a { max-height: 200px; margin-top: 12px; }

.lp-cta-banner {
  background: linear-gradient(120deg, var(--sidebar-bg), var(--primary));
  color: #fff; text-align: center; padding: 56px 32px; border-radius: var(--radius);
  margin: 0 32px 0; max-width: 1080px; margin-left: auto; margin-right: auto;
}
.lp-cta-banner-title { font-size: 26px; font-weight: 800; margin-bottom: 8px; }
.lp-cta-banner-sub { font-size: 14px; opacity: .9; margin-bottom: 22px; }
.lp-cta-banner .lp-cta-btn { background: #fff; color: var(--primary); }

.lp-footer { padding: 40px 32px 32px; text-align: center; color: var(--text-secondary); font-size: 12.5px; }
.lp-footer-links { display: flex; justify-content: center; gap: 20px; margin-bottom: 14px; flex-wrap: wrap; }
.lp-footer-links a { color: var(--text-secondary); text-decoration: none; }
.lp-footer-links a:hover { color: var(--primary); }

/* SEOプリレンダリング対応：JS無効/未実行時（no-js）は常に表示。
   JS実行後（.js）のみスクロール連動フェードインを有効化するプログレッシブエンハンスメント。 */
.lp-reveal { opacity: 1; transform: none; }
.js .lp-reveal { opacity: 0; transform: translateY(24px); transition: opacity 700ms var(--ease-out), transform 700ms var(--ease-out); }
.js .lp-reveal.in-view { opacity: 1; transform: translateY(0); }

@media (max-width: 860px) {
  .lp-header-nav { display: none; }
  .lp-hero-title { font-size: 32px; }
  .lp-grid-3, .lp-pricing-grid { grid-template-columns: 1fr; }
  .lp-steps { flex-direction: column; gap: 24px; }
  .lp-step-arrow { display: none; }
  .lp-hero { padding: 64px 20px 40px; }
  .lp-section { padding: 52px 20px; }
  .lp-cta-banner { margin-left: 20px; margin-right: 20px; padding: 40px 20px; }
}

@media (max-width: 420px) {
  .lp-header { padding: 0 14px; gap: 10px; }
  .lp-header-logo { font-size: 15px; gap: 6px; }
  .lp-header-logo img { height: 22px; }
  .lp-header-right { gap: 10px; }
  .lp-login-link { font-size: 13px; }
  .lp-cta-btn { font-size: 12.5px; padding: 8px 14px; }
  .lp-hero-title { font-size: 27px; }
}

/* ------------------------------------------------------------------ */
/* Legal pages (利用規約・プライバシーポリシー・特商法) — 静的HTML          */
/* ------------------------------------------------------------------ */
.legal-page { min-height: 100vh; display: flex; flex-direction: column; background: var(--white); }
.legal-main { flex: 1; max-width: 780px; margin: 0 auto; padding: 48px 24px 64px; width: 100%; box-sizing: border-box; }
.legal-title { font-size: 26px; font-weight: 800; color: var(--text); letter-spacing: 0.01em; margin-bottom: 6px; }
.legal-updated { color: var(--text-secondary); font-size: 13px; margin-bottom: 28px; }
.legal-h2 {
  font-size: 17px; font-weight: 700; color: var(--text);
  margin-top: 36px; margin-bottom: 12px; padding-bottom: 8px; border-bottom: 1px solid var(--border);
}
.legal-h3 { font-size: 14.5px; font-weight: 700; color: var(--text); margin-top: 20px; margin-bottom: 8px; }
.legal-p { color: var(--text-secondary); line-height: 1.85; margin-bottom: 14px; font-size: 14.5px; }
.legal-page ol, .legal-page ul { padding-left: 22px; margin-bottom: 14px; color: var(--text-secondary); line-height: 1.85; font-size: 14.5px; }
.legal-page li { margin-bottom: 6px; }
.legal-table { width: 100%; border-collapse: collapse; margin-bottom: 20px; font-size: 13.5px; }
.legal-table th, .legal-table td { border: 1px solid var(--border); padding: 9px 12px; text-align: left; }
.legal-table th { background: var(--bg); font-weight: 600; color: var(--text); }
.legal-table td { color: var(--text-secondary); }
.legal-note { border-left: 3px solid var(--border); padding-left: 14px; color: var(--text-secondary); font-size: 13px; line-height: 1.8; margin-bottom: 16px; }

/* ------------------------------------------------------------------ */
/* アップグレードナッジ（バナー）                                        */
/* ------------------------------------------------------------------ */
.nudge-banner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: linear-gradient(90deg, rgba(10,140,158,.10), rgba(0,212,200,.10));
  border: 1px solid rgba(10,140,158,.25);
  border-radius: var(--radius-sm);
  padding: 14px 18px;
  margin-bottom: 20px;
  animation: fadeUp var(--dur-reveal) var(--ease-out);
}
.nudge-banner-text { font-size: 13.5px; font-weight: 600; color: var(--text); }
.nudge-banner-actions { display: flex; align-items: center; gap: 10px; flex-shrink: 0; }
.nudge-close {
  border: none; background: transparent; color: var(--text-secondary); font-size: 18px;
  line-height: 1; cursor: pointer; padding: 4px 6px; border-radius: 6px;
}
.nudge-close:hover { background: rgba(0,0,0,.06); }
@media (max-width: 600px) {
  .nudge-banner { flex-direction: column; align-items: stretch; }
  .nudge-banner-actions { justify-content: space-between; }
}
