/* ============================================
   AI手取りラボ - style.css
   トークン定義 → 全体レイアウト → コンポーネント の順
   ============================================ */

   :root {
    /* Color */
    --color-bg: #F4F6F5;
    --color-surface: #FFFFFF;
    --color-surface-sunken: #EEF1F0;
    --color-text-primary: #14181A;
    --color-text-secondary: #5B6560;
    --color-text-muted: #8B948F;
    --color-border: #DDE3E0;
  
    --color-accent: #0F6E56;       /* ティール(信頼・落ち着き) */
    --color-accent-dark: #0A4E3D;
    --color-accent-bg: #E4F1EC;
  
    --color-indigo: #2B3A67;       /* 見出し等のアクセント差し色 */
  
    --color-net: #0F6E56;          /* 手取り */
    --color-social: #B8C4BE;       /* 社会保険 */
    --color-income-tax: #D9A441;   /* 所得税 */
    --color-resident-tax: #C77B4B; /* 住民税 */
  
    --color-error: #B3261E;
    --color-error-bg: #FBEAE9;
  
    /* Type */
    --font-sans: "Hiragino Sans", "Noto Sans JP", "Yu Gothic", system-ui, -apple-system, sans-serif;
    --font-num: "Roboto Mono", "SF Mono", "Hiragino Sans", monospace;
  
    /* Layout */
    --radius-card: 16px;
    --radius-control: 10px;
    --max-width: 480px;
  }
  
  * {
    box-sizing: border-box;
  }
  
  /* スクリーンリーダー専用(視覚的には非表示・SEO/アクセシビリティ用の見出しに使用) */
  .sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }
  
  html, body {
    margin: 0;
    padding: 0;
  }
  
  body {
    background: var(--color-bg);
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
  }
  
  /* ---------- Header ---------- */
  
  .header {
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
  }
  
  .header__inner {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 20px 18px;
    display: flex;
    align-items: center;
    gap: 12px;
  }
  
  .header__mark {
    flex-shrink: 0;
    width: 40px;
    height: 40px;
    border-radius: 10px;
    background: var(--color-indigo);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    font-size: 16px;
  }
  
  .header__brand {
    margin: 0;
    font-size: 11px;
    letter-spacing: 0.04em;
    color: var(--color-text-muted);
  }
  
  .header__title {
    margin: 2px 0 0;
    font-size: 19px;
    font-weight: 500;
    color: var(--color-text-primary);
  }
  
  /* ---------- Main / layout ---------- */
  
  .main {
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 20px 16px 40px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    padding: 24px 20px;
  }
  
  .card__lead {
    margin: 0 0 20px;
    font-size: 13px;
    color: var(--color-text-secondary);
    text-align: center;
  }
  
  .section-heading {
    margin: 0 0 4px;
    font-size: 15px;
    font-weight: 500;
    color: var(--color-text-primary);
    text-align: center;
  }
  
  .section-subheading {
    margin: 0 0 8px;
    font-size: 12px;
    font-weight: 500;
    color: var(--color-text-secondary);
  }
  
  /* ---------- Form ---------- */
  
  .field {
    margin-bottom: 16px;
  }
  
  .field-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }
  
  label {
    display: block;
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-bottom: 6px;
  }
  
  input,
  select {
    width: 100%;
    height: 46px;
    padding: 0 14px;
    font-size: 16px;
    font-family: var(--font-num);
    color: var(--color-text-primary);
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    appearance: none;
  }
  
  select {
    font-family: var(--font-sans);
    background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='12' height='8'><path d='M1 1l5 5 5-5' stroke='%235B6560' stroke-width='1.5' fill='none' fill-rule='evenodd'/></svg>");
    background-repeat: no-repeat;
    background-position: right 14px center;
    padding-right: 34px;
  }
  
  input:focus,
  select:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 3px var(--color-accent-bg);
  }
  
  .field-note {
    margin: 12px 0 0;
    font-size: 11px;
    color: var(--color-text-muted);
    text-align: center;
  }
  
  /* ---------- インラインエラー ---------- */
  
  .form-error {
    margin: 0 0 16px;
    padding: 12px 14px;
    background: var(--color-error-bg);
    color: var(--color-error);
    border: 1px solid var(--color-error);
    border-radius: var(--radius-control);
    font-size: 13px;
    line-height: 1.6;
  }
  
  .field.field--invalid input,
  .field.field--invalid select {
    border-color: var(--color-error);
    background: var(--color-error-bg);
  }
  
  /* ---------- Buttons ---------- */
  
  .btn-primary {
    width: 100%;
    height: 50px;
    margin-top: 4px;
    background: var(--color-accent);
    color: #fff;
    border: none;
    border-radius: var(--radius-control);
    font-size: 15px;
    font-weight: 500;
    font-family: var(--font-sans);
    cursor: pointer;
  }
  
  .btn-primary:active {
    background: var(--color-accent-dark);
  }
  
  .btn-secondary {
    width: 100%;
    height: 46px;
    margin-top: 20px;
    background: transparent;
    color: var(--color-text-primary);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    font-size: 14px;
    font-family: var(--font-sans);
    cursor: pointer;
  }
  
  .btn-secondary:active {
    background: var(--color-surface-sunken);
  }
  
  /* ---------- Result ---------- */
  
  .result-headline {
    text-align: center;
    padding-bottom: 20px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 20px;
  }
  
  .result-headline__label {
    margin: 0;
    font-size: 12px;
    color: var(--color-text-secondary);
  }
  
  .result-headline__value {
    margin: 6px 0 0;
    font-family: var(--font-num);
    font-size: 40px;
    font-weight: 500;
    color: var(--color-accent);
    font-variant-numeric: tabular-nums;
  }
  
  .result-headline__value .unit {
    font-size: 16px;
    font-family: var(--font-sans);
    color: var(--color-text-secondary);
    margin-left: 4px;
  }
  
  .result-headline__sub {
    margin: 6px 0 0;
    font-size: 12px;
    color: var(--color-text-muted);
  }
  
  .stat-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
  }
  
  .stat-card {
    background: var(--color-surface-sunken);
    border-radius: var(--radius-control);
    padding: 12px;
    text-align: center;
  }
  
  .stat-card__label {
    margin: 0;
    font-size: 11px;
    color: var(--color-text-muted);
  }
  
  .stat-card__value {
    margin: 4px 0 0;
    font-family: var(--font-num);
    font-size: 18px;
    font-weight: 500;
    font-variant-numeric: tabular-nums;
  }
  
  .stat-card__value .unit-sm {
    font-size: 11px;
    font-family: var(--font-sans);
    color: var(--color-text-muted);
    margin-left: 2px;
  }
  
  /* --- signature element: 内訳バー --- */
  
  .breakdown-bar {
    display: flex;
    width: 100%;
    height: 14px;
    border-radius: 7px;
    overflow: hidden;
    background: var(--color-surface-sunken);
  }
  
  .breakdown-bar__segment {
    height: 100%;
    transition: width 0.6s ease;
  }
  
  .breakdown-bar__segment--net         { background: var(--color-net); }
  .breakdown-bar__segment--social      { background: var(--color-social); }
  .breakdown-bar__segment--income-tax  { background: var(--color-income-tax); }
  .breakdown-bar__segment--resident-tax{ background: var(--color-resident-tax); }
  
  .breakdown-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin: 10px 0 20px;
    font-size: 11px;
    color: var(--color-text-secondary);
  }
  
  .breakdown-legend span {
    display: inline-flex;
    align-items: center;
    gap: 5px;
  }
  
  .dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    display: inline-block;
  }
  
  .dot--net         { background: var(--color-net); }
  .dot--social      { background: var(--color-social); }
  .dot--income-tax  { background: var(--color-income-tax); }
  .dot--resident-tax{ background: var(--color-resident-tax); }
  
  /* --- 内訳リスト --- */
  
  .detail-list {
    border-top: 1px solid var(--color-border);
    padding-top: 10px;
  }
  
  .detail-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 0;
    font-size: 13px;
    border-bottom: 1px solid var(--color-border);
  }
  
  .detail-row:last-child {
    border-bottom: none;
  }
  
  .detail-row__label {
    color: var(--color-text-secondary);
  }
  
  .detail-row__value {
    font-family: var(--font-num);
    font-variant-numeric: tabular-nums;
  }
  
  /* ---------- AI社員コメント ---------- */
  
  .ai-comment {
    background: var(--color-accent-bg);
    border-radius: var(--radius-control);
    padding: 12px 14px;
    margin-top: 4px;
  }
  
  .ai-comment__label {
    margin: 0 0 4px;
    font-size: 11px;
    font-weight: 500;
    color: var(--color-accent-dark);
  }
  
  .ai-comment__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.6;
    color: var(--color-accent-dark);
  }
  
  .disclaimer {
    margin: 16px 0 0;
    font-size: 11px;
    line-height: 1.6;
    color: var(--color-text-muted);
    text-align: center;
  }
  
  /* ---------- Footer ---------- */
  
  .footer {
    padding: 20px;
    text-align: center;
    font-size: 11px;
    color: var(--color-text-muted);
  }
  
  /* ---------- Reduced motion ---------- */
  
  @media (prefers-reduced-motion: reduce) {
    .breakdown-bar__segment {
      transition: none;
    }
  }
  
  /* ============================================
     Mission007: v1.1 情報セクション
     ============================================ */
  
  .card--info,
  .card--faq,
  .card--related {
    padding: 24px 20px;
  }
  
  .info-block {
    padding: 16px 0;
    border-bottom: 1px solid var(--color-border);
  }
  
  .info-block:first-of-type {
    padding-top: 18px;
  }
  
  .info-block:last-child {
    padding-bottom: 0;
    border-bottom: none;
  }
  
  .info-block__heading {
    margin: 0 0 6px;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
  }
  
  .info-block__text {
    margin: 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--color-text-secondary);
  }
  
  .assumptions-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
  }
  
  .assumptions-list__item {
    position: relative;
    margin: 0;
    padding: 0 0 12px 18px;
    font-size: 13px;
    line-height: 1.8;
    color: var(--color-text-secondary);
  }
  
  .assumptions-list__item:last-child {
    padding-bottom: 0;
  }
  
  .assumptions-list__item::before {
    content: "";
    position: absolute;
    top: 0.7em;
    left: 2px;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--color-accent);
  }
  
  /* ---------- FAQ accordion ---------- */
  
  .faq-list {
    margin-top: 16px;
    border-top: 1px solid var(--color-border);
  }
  
  .faq-item {
    border-bottom: 1px solid var(--color-border);
  }
  
  .faq-item__q {
    margin: 0;
  }
  
  .faq-item__button {
    width: 100%;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 16px 2px;
    background: transparent;
    border: 0;
    color: var(--color-text-primary);
    font-family: var(--font-sans);
    font-size: 14px;
    font-weight: 600;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
  }
  
  .faq-item__button:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
    border-radius: 4px;
  }
  
  .faq-item__icon {
    flex-shrink: 0;
    width: 10px;
    height: 10px;
    border-right: 2px solid var(--color-accent);
    border-bottom: 2px solid var(--color-accent);
    transform: rotate(45deg);
    transition: transform 0.2s ease;
    margin-right: 3px;
    margin-bottom: 5px;
  }
  
  .faq-item__button[aria-expanded="true"] .faq-item__icon {
    transform: rotate(225deg);
    margin-bottom: -5px;
  }
  
  .faq-item__answer {
    padding: 0 2px 16px;
  }
  
  .faq-item__answer[hidden] {
    display: none;
  }
  
  .faq-item__answer p {
    margin: 0;
    font-size: 13px;
    line-height: 1.8;
    color: var(--color-text-secondary);
  }
  
  /* ---------- Related tools ---------- */
  
  .related-tool-list {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 10px;
  }
  
  .related-tool-card {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 14px;
    color: inherit;
    text-decoration: none;
    background: var(--color-surface-sunken);
    border: 1px solid var(--color-border);
    border-radius: var(--radius-control);
    transition: border-color 0.2s ease, transform 0.2s ease;
  }
  
  .related-tool-card:hover {
    border-color: var(--color-accent);
    transform: translateY(-1px);
  }
  
  .related-tool-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
  }
  
  .related-tool-card__icon {
    flex-shrink: 0;
    width: 36px;
    height: 36px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-indigo);
    color: #fff;
    font-size: 14px;
    font-weight: 600;
  }
  
  .related-tool-card__body {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
  }
  
  .related-tool-card__name {
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-primary);
  }
  
  .related-tool-card__desc {
    margin-top: 2px;
    font-size: 12px;
    color: var(--color-text-secondary);
  }
  
  .related-tool-card__cta {
    flex-shrink: 0;
    font-size: 12px;
    font-weight: 600;
    color: var(--color-accent);
    white-space: nowrap;
  }
  
  @media (max-width: 380px) {
    .related-tool-card {
      align-items: flex-start;
      flex-wrap: wrap;
    }
  
    .related-tool-card__cta {
      width: 100%;
      padding-left: 48px;
    }
  }
  
  @media (prefers-reduced-motion: reduce) {
    .faq-item__icon,
    .related-tool-card {
      transition: none;
    }
  }