:root {
  color-scheme: light;
  --background: #ffffff;
  --foreground: #111827;
  --card: #ffffff;
  --muted: #f7f7f8;
  --muted-foreground: #7b8190;
  --primary: #111827;
  --primary-foreground: #ffffff;
  --secondary: #f5f5f6;
  --secondary-foreground: #111827;
  --border: #eceef2;
  --ring: #111827;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 50% -10%, rgb(241 243 247 / 0.86), transparent 42%),
    linear-gradient(180deg, #ffffff 0%, #fbfbfc 100%);
  color: var(--foreground);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button {
  font: inherit;
}

.page {
  min-height: 100vh;
}

.shell {
  width: min(1120px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 56px;
}

.layout {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 64px;
  align-items: start;
}

.sidebar {
  position: sticky;
  top: 32px;
}

.intro-panel {
  padding: 6px 0;
}

.intro-content {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.intro-description {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--card);
  box-shadow: 0 1px 2px rgb(15 23 42 / 0.05);
}

.card-header {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
}

.card-content {
  padding: 0 20px 20px;
}

.card-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 20px 20px;
}

.title {
  margin: 0;
  font-size: 30px;
  line-height: 1.12;
  font-weight: 650;
  letter-spacing: 0;
}

.section-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.25;
  font-weight: 650;
  letter-spacing: 0;
}

.card-title {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
  font-weight: 650;
  letter-spacing: 0;
}

.description {
  margin: 0;
  color: var(--muted-foreground);
  font-size: 14px;
  line-height: 1.85;
}

.question-text {
  margin: 0;
  color: var(--foreground);
  font-size: 16px;
  line-height: 1.75;
}

.eyebrow {
  width: fit-content;
  color: #a2a8b4;
  font-size: 12px;
  font-weight: 650;
  letter-spacing: 0.08em;
}

.badge {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid transparent;
  border-radius: 6px;
  padding: 2px 10px;
  font-size: 12px;
  line-height: 20px;
  font-weight: 600;
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.badge-outline {
  background: transparent;
  border-color: var(--border);
  color: var(--foreground);
}

.separator {
  height: 1px;
  background: var(--border);
}

.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.section-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.section-heading {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 8px 0;
}

.question-flow {
  display: flex;
  flex-direction: column;
}

.question-row {
  position: relative;
  padding: 27px 0 29px;
}

.question-row::after {
  content: "";
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgb(17 24 39 / 0.11) 18%, rgb(17 24 39 / 0.08) 72%, transparent 100%);
}

.question-row:first-child {
  padding-top: 0;
}

.question-main {
  display: flex;
  align-items: start;
  gap: 24px;
}

.question-number {
  flex: 0 0 34px;
  color: rgb(17 24 39 / 0.18);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 420;
  letter-spacing: 0;
}

.question-body {
  flex: 1 1 auto;
  min-width: 0;
}

.toggle-group {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  justify-items: center;
  gap: 18px;
  margin-top: 18px;
}

.toggle-item {
  display: inline-flex;
  width: 38px;
  height: 38px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(17 24 39 / 0.09);
  border-radius: 50%;
  background: rgb(17 24 39 / 0.015);
  color: rgb(17 24 39 / 0.5);
  cursor: pointer;
  font-size: 14px;
  font-weight: 520;
  transition:
    background-color 180ms ease,
    color 180ms ease,
    border-color 180ms ease,
    opacity 180ms ease;
}

.toggle-item:hover {
  background: rgb(17 24 39 / 0.035);
  border-color: rgb(17 24 39 / 0.16);
  color: rgb(17 24 39 / 0.72);
}

.toggle-item.selected {
  border-color: rgb(17 24 39 / 0.72);
  background: rgb(17 24 39 / 0.72);
  color: rgb(255 255 255 / 0.94);
}

.rating-label-grid {
  display: grid;
  grid-template-columns: repeat(7, minmax(38px, 1fr));
  gap: 18px;
  margin-top: 10px;
  color: rgb(17 24 39 / 0.38);
  font-size: 12px;
}

.rating-label-grid span:first-child {
  grid-column: 1;
  justify-self: center;
  text-align: center;
}

.rating-label-grid span:last-child {
  grid-column: 7;
  justify-self: center;
  text-align: center;
}

.button {
  display: inline-flex;
  height: 40px;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid var(--primary);
  border-radius: 6px;
  background: var(--primary);
  color: var(--primary-foreground);
  cursor: pointer;
  padding: 0 16px;
  font-size: 14px;
  font-weight: 600;
  text-decoration: none;
  box-shadow: 0 12px 28px rgb(17 24 39 / 0.12);
  transition: opacity 140ms ease, background 140ms ease, transform 140ms ease, box-shadow 140ms ease;
}

.button:hover:not(:disabled) {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgb(17 24 39 / 0.16);
}

.button.secondary {
  border-color: var(--border);
  background: var(--secondary);
  color: var(--secondary-foreground);
}

.button.outline {
  border-color: var(--border);
  background: var(--background);
  color: var(--foreground);
}

.button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
  box-shadow: none;
}

.button svg {
  width: 16px;
  height: 16px;
}

.submit-panel {
  display: flex;
  justify-content: flex-end;
  padding-top: 32px;
}

.submit-button {
  min-width: 168px;
}

.result-header {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.result-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
}

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

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

.metric {
  border-radius: 6px;
  background: var(--muted);
  padding: 16px;
}

.metric-label {
  color: var(--muted-foreground);
  font-size: 14px;
}

.metric-value {
  margin-top: 4px;
  font-size: 28px;
  line-height: 1;
  font-weight: 700;
}

.metric-sub {
  margin-top: 4px;
  color: var(--muted-foreground);
  font-size: 12px;
}

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

.fisher-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
}

.fisher-item.selected {
  border-color: var(--primary);
  background: var(--primary);
  color: var(--primary-foreground);
}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .sidebar {
    position: static;
  }

  .result-title-row,
  .result-grid,
  .fisher-grid {
    grid-template-columns: 1fr;
  }

  .result-title-row {
    align-items: flex-start;
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .shell {
    width: min(100% - 24px, 1120px);
    padding: 20px 0;
  }

  .card-header,
  .card-content,
  .card-footer {
    padding-left: 14px;
    padding-right: 14px;
  }

  .card-content,
  .card-footer {
    padding-bottom: 14px;
  }

  .title {
    font-size: 24px;
  }

  .question-main {
    gap: 14px;
  }

  .question-number {
    flex-basis: 28px;
    font-size: 18px;
  }

  .toggle-item {
    width: 34px;
    height: 34px;
    font-size: 13px;
  }

  .toggle-group,
  .rating-label-grid {
    grid-template-columns: repeat(7, minmax(34px, 1fr));
    gap: 7px;
  }

  .submit-panel {
    justify-content: stretch;
  }

  .submit-button {
    width: 100%;
  }
}

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

.top-auth {
  position: fixed;
  top: 18px;
  right: 22px;
  z-index: 20;
  display: flex;
  align-items: center;
  gap: 8px;
}

.auth-login {
  display: inline-flex;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(17 24 39 / 0.1);
  border-radius: 999px;
  background: rgb(255 255 255 / 0.78);
  color: rgb(17 24 39 / 0.72);
  padding: 0 15px;
  font-size: 14px;
  font-weight: 560;
  text-decoration: none;
  backdrop-filter: blur(10px);
}

.auth-placeholder {
  width: 36px;
  height: 36px;
}

.avatar-menu {
  position: relative;
}

.avatar-menu summary {
  list-style: none;
}

.avatar-menu summary::-webkit-details-marker {
  display: none;
}

.avatar-button {
  display: inline-flex;
  width: 36px;
  height: 36px;
  align-items: center;
  justify-content: center;
  border: 1px solid rgb(17 24 39 / 0.08);
  border-radius: 50%;
  background: #4b5563;
  cursor: pointer;
}

.magatama {
  position: relative;
  display: inline-block;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: #ffffff;
}

.magatama::before {
  content: "";
  position: absolute;
  right: -2px;
  bottom: -1px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #4b5563;
}

.magatama::after {
  content: "";
  position: absolute;
  top: 4px;
  left: 4px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: #4b5563;
}

.avatar-popover {
  position: absolute;
  top: 44px;
  right: 0;
  display: flex;
  min-width: 164px;
  flex-direction: column;
  border: 1px solid rgb(17 24 39 / 0.08);
  border-radius: 8px;
  background: rgb(255 255 255 / 0.96);
  padding: 6px;
}

.avatar-popover a,
.avatar-popover button {
  display: flex;
  align-items: center;
  gap: 8px;
  border: 0;
  border-radius: 6px;
  background: transparent;
  color: var(--foreground);
  cursor: pointer;
  padding: 9px 10px;
  font-size: 14px;
  text-align: left;
  text-decoration: none;
}

.avatar-popover a:hover,
.avatar-popover button:hover {
  background: rgb(17 24 39 / 0.045);
}

.login-notice {
  display: inline-flex;
  width: fit-content;
  border-bottom: 1px solid rgb(17 24 39 / 0.18);
  color: rgb(17 24 39 / 0.68);
  font-size: 13px;
  text-decoration: none;
}

.auth-page {
  display: flex;
  min-height: 100vh;
  align-items: center;
  justify-content: center;
  padding: 48px 20px;
}

.auth-form {
  display: flex;
  width: min(380px, 100%);
  flex-direction: column;
  gap: 14px;
}

.brand-mark {
  width: fit-content;
  color: rgb(17 24 39 / 0.55);
  font-size: 13px;
  font-weight: 680;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.auth-title {
  margin: 4px 0 0;
  font-size: 24px;
  line-height: 1.2;
  font-weight: 650;
}

.auth-subtitle {
  margin: 0 0 8px;
  color: var(--muted-foreground);
  font-size: 14px;
}

.auth-subtitle a {
  color: var(--foreground);
}

.field-label {
  color: rgb(17 24 39 / 0.72);
  font-size: 13px;
  font-weight: 560;
}

.field-input {
  height: 40px;
  border: 1px solid rgb(17 24 39 / 0.12);
  border-radius: 7px;
  background: rgb(255 255 255 / 0.86);
  color: var(--foreground);
  padding: 0 12px;
  font: inherit;
  outline: none;
}

.field-input:focus {
  border-color: rgb(17 24 39 / 0.34);
}

.consent-row {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  color: var(--muted-foreground);
  font-size: 12px;
  line-height: 1.6;
}

.form-error {
  margin: 0;
  color: #9f1239;
  font-size: 13px;
}

.auth-submit {
  width: 100%;
  margin-top: 6px;
  box-shadow: none;
}

.account-page {
  padding-top: 74px;
}

.account-header {
  margin-bottom: 26px;
}

.account-identity {
  display: flex;
  align-items: center;
  gap: 14px;
}

.account-identity .magatama {
  box-sizing: content-box;
  border: 9px solid #4b5563;
  background: #fff;
}

.account-grid {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 42px;
  align-items: start;
}

.account-tabs {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.account-tabs a {
  border-radius: 6px;
  color: rgb(17 24 39 / 0.58);
  padding: 8px 10px;
  font-size: 14px;
  text-decoration: none;
}

.account-tabs a:hover {
  background: rgb(17 24 39 / 0.045);
  color: var(--foreground);
}

.account-main,
.account-section {
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.account-section {
  border-top: 1px solid rgb(17 24 39 / 0.08);
  padding: 22px 0 30px;
}

.history-item {
  border-top: 1px solid rgb(17 24 39 / 0.08);
  padding: 18px 0;
}

.history-top,
.history-actions,
.line-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.history-top h3 {
  margin: 0 0 4px;
  font-size: 16px;
  font-weight: 620;
}

.history-actions {
  flex-wrap: wrap;
}

.history-runs {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin-top: 12px;
}

.line-item {
  border-radius: 6px;
  color: var(--foreground);
  padding: 9px 10px;
  text-decoration: none;
}

.line-item:hover {
  background: rgb(17 24 39 / 0.04);
}

.security-events {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.result-json {
  overflow: auto;
  border: 1px solid rgb(17 24 39 / 0.08);
  border-radius: 8px;
  background: rgb(17 24 39 / 0.025);
  padding: 14px;
  font-size: 12px;
  line-height: 1.6;
}

@media (max-width: 760px) {
  .top-auth {
    top: 12px;
    right: 12px;
  }

  .account-grid {
    grid-template-columns: 1fr;
    gap: 20px;
  }

  .account-tabs {
    position: static;
    flex-direction: row;
    flex-wrap: wrap;
  }

  .history-top {
    align-items: flex-start;
    flex-direction: column;
  }
}


.unlock-panel {
  border-color: #d7dee8;
}

.unlock-content {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.pay-code {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--muted);
  overflow-wrap: anywhere;
}

.pay-code span {
  color: var(--muted-foreground);
  font-size: 13px;
}

.pay-code a {
  color: var(--foreground);
  font-weight: 650;
}

.payment-error {
  margin: 0;
  color: #b42318;
  font-size: 14px;
  line-height: 1.5;
}

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