:root {
  color-scheme: light;
  --bg: #f5f7f8;
  --surface: #ffffff;
  --surface-soft: #f8fafb;
  --surface-strong: #eef2f4;
  --line: #e1e6e9;
  --line-strong: #cbd3d8;
  --text: #182026;
  --muted: #59656f;
  --faint: #75818a;
  --accent: #c8ff2e;
  --accent-ink: #1b2500;
  --accent-soft: #f2ffd1;
  --success: #067647;
  --success-soft: #ecfdf3;
  --warning: #a15c00;
  --warning-soft: #fff8e6;
  --danger: #b42318;
  --danger-soft: #fff1f0;
  --header-height: 74px;
  font-family:
    Inter, "Noto Sans JP", "Hiragino Kaku Gothic ProN", "Yu Gothic",
    "Meiryo", ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
}

* { box-sizing: border-box; }
html { background: var(--bg); }
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-size: 16px;
  line-height: 1.65;
}
button, input, select { font: inherit; }
a { color: inherit; }
[hidden] { display: none !important; }

.auth-gate {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 28px;
  background:
    radial-gradient(circle at 18% 10%, rgba(200, 255, 46, 0.24), transparent 24rem),
    linear-gradient(180deg, #fbfcfc 0%, #f3f6f7 100%);
}

.auth-panel {
  width: min(100%, 560px);
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 28px 80px rgba(18, 32, 38, 0.12);
}

.brand-lockup,
.sidebar-brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  border-radius: 13px;
  background: var(--accent);
  color: var(--accent-ink);
  font-weight: 900;
  letter-spacing: -0.08em;
}

.brand-name,
.eyebrow,
.topbar-kicker {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: .04em;
}

.auth-panel h1 {
  margin: 0;
  font-size: clamp(30px, 5vw, 44px);
  line-height: 1.15;
  letter-spacing: -.035em;
}

.auth-copy {
  margin: 26px 0;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.notice {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  font-size: 15px;
  line-height: 1.65;
}

.notice-neutral {
  background: var(--surface-soft);
  color: var(--muted);
}

.notice-success {
  border-color: #abefc6;
  background: var(--success-soft);
  color: var(--success);
}

.notice-error {
  border-color: #fecdca;
  background: var(--danger-soft);
  color: var(--danger);
}

.dev-login { margin-top: 22px; }
.dev-login label {
  display: block;
  margin-bottom: 8px;
  color: var(--text);
  font-size: 15px;
  font-weight: 700;
}

.auth-row {
  display: flex;
  gap: 10px;
}

.auth-row input {
  flex: 1;
  min-width: 0;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  background: #fff;
  color: var(--text);
}

.field-note {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.button {
  min-height: 44px;
  border: 0;
  border-radius: 12px;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
}

.button-primary {
  background: var(--accent);
  color: var(--accent-ink);
}

.button-primary:hover { filter: brightness(.97); }

.button-muted {
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text);
}

.button:disabled {
  cursor: not-allowed;
  opacity: .55;
}

.portal { min-height: 100vh; }

.sidebar {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--header-height);
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 28px;
  padding: 12px clamp(20px, 4vw, 54px);
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, .96);
  backdrop-filter: blur(16px);
}

.sidebar-brand {
  text-decoration: none;
  white-space: nowrap;
}

.sidebar-brand strong,
.sidebar-brand small {
  display: block;
}

.sidebar-brand strong {
  font-size: 13px;
  line-height: 1.2;
  letter-spacing: .04em;
}

.sidebar-brand small {
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
}

.nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.nav-item {
  position: relative;
  min-height: 42px;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 0 14px;
  border-radius: 11px;
  color: var(--muted);
  text-decoration: none;
  font-size: 15px;
  font-weight: 750;
}

.nav-item:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.nav-item.active {
  background: var(--accent-soft);
  color: #334600;
}

.nav-badge {
  min-width: 20px;
  height: 20px;
  display: inline-grid;
  place-items: center;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 900;
}

.sidebar-footer {
  display: flex;
  align-items: center;
  gap: 8px;
}

.account-link {
  display: flex;
  align-items: center;
  min-width: 190px;
  padding: 8px 10px;
  border-radius: 11px;
  text-decoration: none;
}

.account-link:hover { background: var(--surface-soft); }
.account-link strong,
.account-link small { display: block; }
.account-link strong {
  max-width: 180px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}
.account-link small {
  margin-top: 2px;
  color: var(--muted);
  font-size: 11px;
}

.ghost-button {
  min-height: 40px;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  font-size: 13px;
}

.ghost-button:hover {
  background: var(--surface-soft);
  color: var(--text);
}

.icon-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
}

.main { min-height: calc(100vh - var(--header-height)); }

.topbar {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 66px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 18px clamp(24px, 5vw, 64px) 0;
}

.topbar-kicker { margin-bottom: 1px; }
.topbar-message {
  margin: 0;
  color: var(--text);
  font-size: 15px;
  font-weight: 650;
}

.environment-pill,
.role-chip {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-soft);
  color: var(--muted);
  font-size: 12px;
  font-weight: 750;
}

.environment-pill {
  background: #fff8e6;
  border-color: #f3d79c;
  color: #8a5300;
}

.view {
  display: none;
  width: min(100%, 1280px);
  margin: 0 auto;
  padding: 34px clamp(24px, 5vw, 64px) 80px;
}

.view.active { display: block; }

.hero-row,
.section-heading {
  max-width: 840px;
}

.hero-row { margin-bottom: 30px; }

h2 {
  margin: 0;
  font-size: clamp(34px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -.045em;
}

h3 {
  margin: 0;
  font-size: 20px;
  line-height: 1.4;
  letter-spacing: -.018em;
}

.lead,
.section-heading > p:last-child {
  margin: 12px 0 0;
  max-width: 720px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.8;
}

.section-heading { margin-bottom: 22px; }
.section-heading h2 { font-size: clamp(32px, 4vw, 44px); }

.metric-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.metric-card {
  min-height: 168px;
  display: flex;
  flex-direction: column;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(18, 32, 38, .035);
}

.metric-card > span {
  color: var(--muted);
  font-size: 15px;
  font-weight: 700;
}

.metric-card strong {
  margin-top: 20px;
  color: var(--text);
  font-size: clamp(32px, 4vw, 42px);
  line-height: 1;
  letter-spacing: -.04em;
}

.metric-card small {
  margin-top: auto;
  padding-top: 14px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.metric-card.is-good {
  border-color: #abefc6;
  background: linear-gradient(180deg, #fff 0%, #f4fff8 100%);
}

.metric-card.is-attention {
  border-color: #f3d79c;
  background: linear-gradient(180deg, #fff 0%, #fffaf0 100%);
}

.metric-card.is-danger {
  border-color: #fecdca;
  background: linear-gradient(180deg, #fff 0%, #fff5f4 100%);
}

.home-quick-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: -8px 0 22px;
}

.home-action-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 132px;
  text-decoration: none;
}

.home-next-action {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  border-color: var(--line-strong);
}

.home-next-action > div { min-width: 0; }

.home-next-action h3 {
  margin-top: 2px;
  font-size: 22px;
}

.home-next-action p:last-child { margin: 6px 0 0; }

.home-next-action .home-next-action-link {
  flex: 0 0 auto;
  text-decoration: none;
}

.home-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(300px, .7fr);
  gap: 16px;
  margin-top: 16px;
}

.home-side {
  display: grid;
  gap: 16px;
}

.panel {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 24px;
  background: var(--surface);
  box-shadow: 0 3px 14px rgba(18, 32, 38, .03);
}

.home-primary { min-height: 300px; }

.panel-heading {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
}

.text-link {
  color: #3e5d00;
  font-size: 14px;
  font-weight: 800;
  text-decoration: none;
}

.text-link:hover { text-decoration: underline; }

.empty-state {
  min-height: 150px;
  display: flex;
  align-items: center;
  color: var(--muted);
}

.empty-state strong {
  color: var(--text);
  font-size: 16px;
}

.empty-state p {
  margin: 6px 0 0;
  line-height: 1.7;
}

.home-current-ads {
  display: grid;
  gap: 10px;
  margin-top: 18px;
}

.home-ad-row {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 17px 0;
  border-top: 1px solid var(--line);
}

.home-ad-row:first-child { border-top: 0; }

.home-ad-row h4 {
  margin: 3px 0 6px;
  font-size: 18px;
}

.home-ad-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  color: var(--muted);
  font-size: 14px;
}

.status-line {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--success);
  font-size: 14px;
  font-weight: 800;
}

.status-dot {
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: currentColor;
}

.offer-preview {
  background: linear-gradient(145deg, #fbffe8 0%, #fff 58%);
  border-color: #d8e9a6;
}

.offer-preview h3,
.help-card h3 { margin-top: 4px; }

.offer-preview p,
.help-card p {
  color: var(--muted);
  line-height: 1.75;
}

.subnav {
  display: flex;
  gap: 8px;
  margin: 0 0 22px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.subnav-link {
  display: inline-flex;
  min-height: 38px;
  align-items: center;
  padding: 0 12px;
  border-radius: 10px;
  color: var(--muted);
  text-decoration: none;
  font-size: 14px;
  font-weight: 750;
}

.subnav-link:hover,
.subnav-link.active {
  background: var(--surface-strong);
  color: var(--text);
}

.profile-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.muted { color: var(--muted); }
.mono {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 13px;
}

select,
input[type="text"],
input[type="email"],
input[type="file"] {
  color-scheme: light;
}

@media (max-width: 1100px) {
  .sidebar {
    grid-template-columns: auto auto;
  }

  .nav {
    display: none;
    grid-column: 1 / -1;
    width: 100%;
    align-items: stretch;
    justify-content: stretch;
    padding-top: 8px;
  }

  .sidebar.open .nav {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .sidebar-footer {
    justify-self: end;
  }

  .icon-button { display: inline-grid; place-items: center; }

  .metric-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .sidebar {
    padding-inline: 18px;
  }

  .sidebar.open .nav {
    grid-template-columns: 1fr;
  }

  .account-link { min-width: 0; }
  .account-link span { display: none; }
  #logout-button { padding-inline: 8px; }

  .topbar {
    padding-inline: 20px;
  }

  .view {
    padding: 26px 20px 64px;
  }

  .home-grid,
  .profile-grid {
    grid-template-columns: 1fr;
  }

  .home-next-action {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  body { font-size: 15px; }

  .auth-gate { padding: 16px; }
  .auth-panel { padding: 26px 22px; }
  .auth-row { flex-direction: column; }

  .sidebar-brand small { display: none; }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  .home-quick-actions {
    display: grid;
    grid-template-columns: 1fr;
  }

  .home-action-link { width: 100%; }

  .metric-card {
    min-height: 140px;
  }

  .topbar {
    align-items: flex-start;
  }

  .environment-pill { display: none; }

  .panel { padding: 20px; }

  .home-ad-row {
    grid-template-columns: 1fr;
  }
}


.invitation-landing-state {
  margin: 24px 0 18px;
  padding: 20px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  background: var(--surface-soft);
}

.invitation-landing-state h2 {
  margin: 2px 0 8px;
  font-size: clamp(22px, 4vw, 28px);
  line-height: 1.25;
  letter-spacing: -.025em;
}

.invitation-landing-state p:not(.eyebrow) {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}


.v4-pricing-hold {
  margin-bottom: 18px;
  border-color: #f3d79c;
  background: var(--warning-soft);
  color: var(--warning);
}

.v4-price-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-bottom: 16px;
}

.v4-price-card {
  min-height: 300px;
  display: flex;
  flex-direction: column;
}

.v4-price-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.v4-price-card .muted {
  margin: 8px 0 14px;
  font-size: 13px;
}

.v4-price-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 0;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

.v4-price-row strong {
  color: var(--text);
  font-size: 17px;
}

.v4-price-row.is-launch strong { color: #3e5d00; }

.v4-price-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
}

.v4-price-actions .button {
  min-height: 42px;
  padding-inline: 10px;
  font-size: 12px;
  text-align: center;
}

.v4-inquiry {
  margin-top: auto;
  padding-top: 28px;
  color: var(--text);
  font-size: 22px;
  font-weight: 850;
}

.v4-inquiry .button {
  width: 100%;
  min-height: 42px;
  padding-inline: 10px;
  font-size: 12px;
  text-align: center;
}

.v4-pricing-section { margin-top: 16px; }
.v4-pricing-section > p { color: var(--muted); }

.v4-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 22px;
  margin: 18px 0 0;
  padding-left: 20px;
}

.v4-option-list {
  display: grid;
  gap: 0;
  margin-top: 14px;
}

.v4-option-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: 14px 0;
  border-top: 1px solid var(--line);
}

.v4-option-row small {
  display: block;
  margin-top: 3px;
  color: var(--muted);
}

.v4-option-row > span {
  flex: 0 0 auto;
  font-weight: 800;
}

@media (max-width: 980px) {
  .v4-price-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 560px) {
  .v4-price-grid,
  .v4-list { grid-template-columns: 1fr; }
  .v4-price-card { min-height: 0; }
  .v4-price-actions { grid-template-columns: 1fr; }
}


.portal-reason-dialog {
  width: min(520px, calc(100vw - 32px));
  border: 0;
  border-radius: 16px;
  padding: 0;
  background: var(--surface);
  color: var(--text);
  box-shadow: 0 24px 80px rgba(15, 23, 42, .22);
}
.portal-reason-dialog::backdrop { background: rgba(15, 23, 42, .48); }
.portal-reason-dialog__body { padding: 24px; }
.portal-reason-dialog__body h3 { margin: 0; font-size: 18px; }
.portal-reason-dialog__body .field { display: grid; gap: 8px; margin-top: 18px; }
.portal-reason-dialog__input { width: 100%; resize: vertical; }
.portal-reason-dialog__actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 20px; }
