/*
 * 自社開発（/inhouse/）。実績ページ（works.css）の上に重ねる。
 * 設計メモ: project-files/portfolio-research/inhouse-design-plan.md（v2）
 * 地は「記録紙」。主役は一覧冒頭の見張りの記録（.ih-record）で、濃い面は詳細のメインビジュアルの台だけ。
 */

.w-body {
  --ih-paper: #EEF3EF;
  --ih-grid: #DCE6DF;
  --ih-rule: #C3D2C8;
  --ih-ink: #14211B;
  --ih-muted: #56665C;
  --ih-green: #0F6535;
  --ih-amber: #C7861A;
  --ih-amber-ink: #8A5A0C;
  --ih-red: #C8372D;
  --ih-leaf: #E4EEE7;
}

.ih-nowrap { white-space: nowrap; }
.w-header__nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; }

.ih-main { background: var(--ih-paper); color: var(--ih-ink); padding-bottom: 96px; }
.ih-main a { color: var(--ih-green); }
.ih-h2 { font-weight: 900; font-size: 28px; line-height: 1.4; color: var(--ih-ink); margin: 0; font-feature-settings: "palt"; letter-spacing: .02em; }
.ih-fine { font-size: 13px; color: var(--ih-muted); margin: 12px 0 0; }
.ih-notice { background: #fff; border: 1px solid var(--ih-rule); border-radius: 4px; padding: 20px 24px; margin: 48px 0 0; }

/* ---------------------------------------------------------------- 一覧の冒頭 */
.ih-hero { padding: 72px 0 0; }
.ih-hero__title { font-weight: 900; font-size: 60px; line-height: 1.22; letter-spacing: .01em; font-feature-settings: "palt"; margin: 0 0 24px; color: var(--ih-ink); }
.ih-hero__title span { display: inline-block; }
.ih-hero__lead { font-size: 18px; line-height: 1.9; max-width: 34em; margin: 0 0 48px; color: var(--ih-ink); }

/* 見張りの記録（記録紙） */
.ih-record {
  margin: 0;
  background: #fff;
  border: 1px solid var(--ih-rule);
  border-radius: 4px;
  padding: 22px 28px 18px;
}
.ih-record__head { font-weight: 700; font-size: 16px; margin: 0 0 10px; }
.ih-record__head span { font-weight: 500; color: var(--ih-muted); font-size: 14px; }
.ih-record__legend { display: flex; flex-wrap: wrap; gap: 6px 20px; margin: 8px 0 0; font-size: 13px; color: var(--ih-muted); }
.ih-record__legend span { display: inline-flex; align-items: center; gap: 8px; }
.ih-record__legend span::before { content: ""; width: 3px; height: 14px; background: var(--ih-green); }
.ih-record__legend .is-fail::before { background: var(--ih-red); }
.ih-record__legend .is-alert::before { width: 9px; height: 9px; background: var(--ih-amber); transform: rotate(45deg); }

.ih-strip { display: block; width: 100%; height: auto; font-family: inherit; overflow: visible; }
.ih-strip.is-tall { display: none; }
.ih-s-grid { stroke: var(--ih-grid); stroke-width: 1; }
.ih-s-grid.is-major { stroke: var(--ih-rule); }
.ih-s-hour { font-size: 12px; fill: var(--ih-muted); font-variant-numeric: tabular-nums; }
.ih-s-base { stroke: #9DB2A4; stroke-width: 1; }
.ih-s-name { font-size: 15px; font-weight: 700; fill: var(--ih-ink); }
.ih-s-sub { font-size: 12px; font-weight: 500; fill: var(--ih-muted); }
.ih-s-tick { fill: var(--ih-green); }
.ih-s-tick.is-fail { fill: var(--ih-red); }
.ih-s-tick.is-alert { fill: var(--ih-amber); }
.ih-s-band { fill: #FBE6E2; }
.ih-s-mark { fill: var(--ih-amber); }
.ih-s-mark.is-ok { fill: var(--ih-green); }
.ih-s-note { font-size: 13px; font-weight: 700; fill: var(--ih-amber-ink); font-variant-numeric: tabular-nums; paint-order: stroke; stroke: #fff; stroke-width: 4px; stroke-linejoin: round; }
.ih-s-note.is-ok { fill: var(--ih-green); }
.ih-s-pen { display: none; fill: #fff; }

/* 読み込み時に1回だけ、記録計のペンが左から右へ走る（ページで動くのはここだけ） */
@media (prefers-reduced-motion: no-preference) {
  .ih-s-pen { display: block; transform-box: fill-box; transform-origin: 100% 50%; animation: ih-pen 2.2s cubic-bezier(.45, .05, .35, 1) .3s both; }
}
@keyframes ih-pen { from { transform: scaleX(1); } to { transform: scaleX(0); } }

/* ---------------------------------------------------------------- 一覧の各ブロック */
.ih-block { margin-top: 96px; }
.ih-block__head { margin-bottom: 24px; }
.ih-block__head .ih-h2 { font-size: 34px; margin-bottom: 8px; }
.ih-block__head p { margin: 0; color: var(--ih-muted); max-width: 40em; }
.ih-block__head p a { font-weight: 700; text-decoration: underline; text-underline-offset: 3px; margin-left: 6px; }

.ih-tools { list-style: none; padding: 0; margin: 0; border-top: 2px solid var(--ih-ink); }
.ih-tool { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: start; padding: 40px 0; border-bottom: 1px solid var(--ih-rule); }
.ih-tool__shot { display: block; line-height: 0; border: 1px solid var(--ih-rule); border-radius: 8px; overflow: hidden; background: #fff; }
.ih-tool__shot .ih-scr { width: 100%; height: auto; }
.ih-tool__name { font-size: 28px; font-weight: 900; line-height: 1.35; font-feature-settings: "palt"; margin: 4px 0 10px; display: flex; flex-wrap: wrap; align-items: center; gap: 12px; }
.ih-main .ih-tool__name a { color: var(--ih-ink); }
.ih-main .ih-tool__name a:hover { color: var(--ih-green); text-decoration: underline; text-underline-offset: 5px; }
.ih-tool__line { margin: 0 0 18px; max-width: 34em; }
.ih-tool .w-phasebar { margin-bottom: 14px; }
.ih-tool__cases { margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--ih-rule); font-size: 14px; }
.ih-tool__cases p { margin: 0 0 2px; font-weight: 700; color: var(--ih-muted); font-size: 13px; }
.ih-tool__cases ul { list-style: none; padding: 0; margin: 0; }
.ih-tool__cases a { text-decoration: underline; text-underline-offset: 3px; }

.ih-techs { list-style: none; display: flex; flex-wrap: wrap; gap: 6px; padding: 0; margin: 0; }
.ih-techs li { font-size: 12px; background: #fff; border: 1px solid var(--ih-rule); border-radius: 3px; padding: 0 8px; color: var(--ih-ink); }

.ih-map { margin: 0; background: #fff; border: 1px solid var(--ih-rule); border-radius: 4px; padding: 24px 28px; }
.ih-map .ih-diagram.is-wide { max-width: 980px; margin: 0 auto; }

.ih-rules__list { margin: 0; border-top: 2px solid var(--ih-ink); }
.ih-rules__list div { display: grid; grid-template-columns: minmax(0, 15em) minmax(0, 1fr); gap: 4px 48px; padding: 18px 0; border-bottom: 1px solid var(--ih-rule); }
.ih-rules__list dt { font-weight: 700; font-size: 17px; }
.ih-rules__list dd { margin: 0; max-width: 40em; }

/* ---------------------------------------------------------------- 構成図（共通） */
.ih-diagram { display: block; width: 100%; height: auto; font-family: inherit; }
.ih-diagram.is-tall { display: none; max-width: 420px; margin: 0 auto; }

/* 色と箱の形は、実績ページの構成図（共通アイコンセットの README）にそろえる */
.ih-d-zone { fill: #f2f7f7; stroke: none; }
.ih-d-zone.is-client { fill: #fff; stroke: #b9c5c8; stroke-dasharray: 6 5; stroke-width: 1.5; }
.ih-d-zlabel { font-size: 13px; font-weight: 700; fill: #0a7f87; }

.ih-d-node > rect { fill: #e6f4f5; stroke: #0aa1aa; stroke-width: 2; }
.ih-d-node.is-client > rect, .ih-d-node.is-ext > rect { fill: #fff; stroke: #9fb4b9; }
.ih-d-iconbg { fill: #fff; stroke: #bfe3e6; stroke-width: 2; }
.ih-d-node.is-client .ih-d-iconbg, .ih-d-node.is-ext .ih-d-iconbg { stroke: #d5dee0; }
.ih-d-icon { color: #0a7f87; }
.ih-d-node.is-client .ih-d-icon, .ih-d-node.is-ext .ih-d-icon { color: #3d5a63; }
.ih-d-name { font-size: 15px; font-weight: 700; fill: #1f2d33; }
.ih-d-sub { font-size: 12px; fill: #4f6168; }

.ih-d-edge { fill: none; stroke: #4a5a60; stroke-width: 2; }
.ih-d-edge.is-signal { stroke: var(--ih-amber); stroke-width: 3; }
.ih-d-arrow { fill: #4a5a60; }
.ih-d-arrow.is-signal { fill: var(--ih-amber); }
.ih-d-lbg { fill: #fff; stroke: #d5dee0; }
.ih-d-ltext { font-size: 12px; font-weight: 700; fill: #1f2d33; }
.ih-d-ltext.is-signal { fill: #8a5a0c; }


/* ---------------------------------------------------------------- 詳細 */
.ih-crumb { font-size: 13px; color: var(--ih-muted); padding: 24px 0 0; }
.ih-main .ih-crumb a { color: var(--ih-muted); text-decoration: underline; text-underline-offset: 3px; }
.ih-head { padding: 40px 0 0; }
.ih-head__kind { font-size: 14px; font-weight: 700; color: var(--ih-green); margin: 0 0 8px; display: flex; align-items: center; gap: 10px; }
.ih-head__title { font-weight: 900; font-size: 40px; line-height: 1.4; letter-spacing: .01em; font-feature-settings: "palt"; margin: 0 0 16px; max-width: 26em; }
.ih-head__lead { font-size: 18px; margin: 0; max-width: 36em; }

.ih-visual { margin: 40px 0 0; }
.ih-visual__stage {
  background-color: var(--ih-green);
  background-image: linear-gradient(rgba(255,255,255,.06) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,.06) 1px, transparent 1px);
  background-size: 24px 24px;
  border-radius: 6px; padding: 56px 64px; display: flex; align-items: center; justify-content: center; gap: 36px;
}
.ih-visual__pc { flex: 1 1 auto; max-width: 820px; }
.ih-visual__sp { flex: 0 0 19%; max-width: 196px; margin-right: 4px; }
.ih-visual__pc .ih-scr { width: 100%; height: auto; display: block; border-radius: 8px; box-shadow: 0 18px 40px rgba(4, 30, 15, .35); }
.ih-visual__sp .ih-scr { width: 100%; height: auto; display: block; }
.ih-scr.is-phone { border-radius: 26px; outline: 7px solid var(--ih-ink); outline-offset: -1px; box-shadow: 0 18px 40px rgba(4, 30, 15, .35); }
.ih-visual figcaption { font-size: 13px; color: var(--ih-muted); margin-top: 10px; }

.ih-sheet { background: #fff; border: 1px solid var(--ih-rule); border-radius: 4px; padding: 24px 32px 12px; margin: 32px 0 0; }
.ih-sheet__phase { margin-bottom: 8px; }
.ih-sheet__label { font-weight: 700; margin: 0 0 6px; }
.ih-sheet__table th { color: var(--ih-ink); width: 7em; }
.ih-sheet__table tr:last-child th, .ih-sheet__table tr:last-child td { border-bottom: 0; }
.ih-sheet .ih-techs { margin-top: 10px; }
.ih-sheet .ih-techs li { background: var(--ih-paper); }

.ih-article { margin-top: 24px; }
.ih-sec { display: grid; grid-template-columns: minmax(0, 13em) minmax(0, 1fr); gap: 12px 48px; padding: 48px 0 0; margin-top: 48px; border-top: 2px solid var(--ih-ink); }
.ih-sec .ih-h2 { font-size: 22px; }
.ih-sec__body { min-width: 0; margin: 0; }
.ih-sec__body > p { margin: 0 0 10px; max-width: 40em; }

.ih-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 20px; }
.ih-shot { margin: 0; }
.ih-shot .ih-scr { width: 100%; height: auto; display: block; border-radius: 8px; border: 1px solid var(--ih-rule); }
.ih-shot figcaption { font-size: 13px; color: var(--ih-muted); margin-top: 6px; }

.ih-diagram-wrap .ih-diagram { background: #fff; border: 1px solid var(--ih-rule); border-radius: 4px; }
.ih-diagram-wrap figcaption { font-size: 14px; color: var(--ih-muted); margin-top: 10px; max-width: 44em; }

.ih-features { width: 100%; border-collapse: collapse; }
.ih-features thead th { font-size: 13px; font-weight: 700; color: var(--ih-muted); text-align: left; padding: 0 12px 8px 0; border-bottom: 1px solid var(--ih-ink); }
.ih-features tbody th, .ih-features td { text-align: left; vertical-align: top; padding: 16px 16px 16px 0; border-bottom: 1px solid var(--ih-rule); }
.ih-features tbody th { font-weight: 700; width: 11em; }
.ih-features td { width: 40%; }
.ih-features td.is-how { color: var(--ih-muted); font-size: 15px; padding-right: 0; }

.ih-usage + .ih-usage { margin-top: 20px; }
.ih-usage p { margin: 0 0 10px; max-width: 40em; }
.ih-usage__cases { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ih-rule); }
.ih-usage__cases li { border-bottom: 1px solid var(--ih-rule); }
.ih-main .ih-usage__cases a { display: grid; grid-template-columns: 7em minmax(0, 1fr) minmax(0, 15em); gap: 4px 20px; align-items: center; padding: 14px 0; color: var(--ih-ink); }
.ih-usage__kind { font-size: 13px; font-weight: 700; color: #8E5513; }
.ih-usage__title { font-weight: 700; color: var(--ih-green); line-height: 1.5; }
.ih-usage__cases a:hover .ih-usage__title { text-decoration: underline; text-underline-offset: 3px; }
.ih-usage__cases .w-phasebar { margin: 0; }

.ih-related__list { list-style: none; padding: 0; margin: 0; border-top: 1px solid var(--ih-rule); }
.ih-related__list li { border-bottom: 1px solid var(--ih-rule); }
.ih-main .ih-related__list a { display: grid; grid-template-columns: minmax(0, 16em) minmax(0, 1fr); gap: 2px 20px; padding: 14px 0; color: var(--ih-ink); }
.ih-related__name { font-weight: 700; color: var(--ih-green); }
.ih-related__list a:hover .ih-related__name { text-decoration: underline; text-underline-offset: 3px; }
.ih-related__line { font-size: 14px; color: var(--ih-muted); }

.ih-back { margin: 56px 0 0; }
.ih-main .ih-back a { color: var(--ih-ink); font-weight: 700; text-decoration: underline; text-underline-offset: 4px; }

/* 実績の記事に出す「この案件で使っている自社ツール」 */
.ih-used__note { color: var(--w-muted); }
.ih-used__list { list-style: none; padding: 0; margin: 0; display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; }
.ih-used__list a { display: block; background: var(--ih-leaf); border-radius: 10px; padding: 14px 16px; color: inherit; height: 100%; }
.ih-used__list a:hover .ih-used__name { text-decoration: underline; }
.ih-used__name { display: block; font-weight: 700; color: var(--ih-green); }
.ih-used__name::before { content: "自社開発"; font-size: 11px; font-weight: 700; color: #fff; background: var(--ih-green); border-radius: 4px; padding: 1px 6px; margin-right: 8px; vertical-align: 2px; }
.ih-used__lead { display: block; font-size: 14px; color: var(--ih-muted); margin-top: 2px; }

/* キーボード操作の見た目 */
.ih-main a:focus-visible, .ih-used a:focus-visible { outline: 3px solid var(--ih-green); outline-offset: 3px; border-radius: 2px; }

@media (max-width: 960px) {
  .ih-hero__title { font-size: 46px; }
  .ih-tool { gap: 28px; }
  .ih-tool__name { font-size: 24px; }
  .ih-rules__list div, .ih-sec { grid-template-columns: 1fr; }
  .ih-sec { gap: 16px; }
  .ih-visual__stage { padding: 36px; gap: 24px; }
}

@media (max-width: 640px) {
  .ih-main { padding-bottom: 64px; }
  .ih-hero { padding-top: 40px; }
  .ih-hero__title { font-size: 34px; line-height: 1.3; margin-bottom: 16px; }
  .ih-hero__lead { font-size: 16px; margin-bottom: 28px; }
  .ih-record { padding: 16px 14px 14px; }
  .ih-strip.is-wide, .ih-diagram.is-wide { display: none; }
  .ih-strip.is-tall, .ih-diagram.is-tall { display: block; }
  .ih-block { margin-top: 64px; }
  .ih-h2, .ih-block__head .ih-h2 { font-size: 24px; }
  .ih-tool { grid-template-columns: 1fr; gap: 16px; padding: 28px 0; }
  .ih-tool__name { font-size: 22px; }
  .ih-map { padding: 16px 12px; }
  .ih-head { padding-top: 28px; }
  .ih-head__title { font-size: 26px; }
  .ih-head__lead { font-size: 16px; }
  .ih-visual { margin-top: 24px; }
  .ih-visual__stage { padding: 20px 14px; gap: 12px; border-radius: 4px; }
  .ih-scr.is-phone { border-radius: 14px; outline-width: 4px; }
  .ih-sheet { padding: 16px 16px 4px; }
  .ih-sec { padding-top: 32px; margin-top: 32px; }
  .ih-shots { grid-template-columns: 1fr; }
  .ih-features thead { display: none; }
  .ih-features, .ih-features tbody, .ih-features tr, .ih-features tbody th, .ih-features td { display: block; width: auto; }
  .ih-features tr { padding: 14px 0; border-bottom: 1px solid var(--ih-rule); }
  .ih-features tbody th, .ih-features td { border: 0; padding: 0; }
  .ih-features tbody th { margin-bottom: 4px; }
  .ih-features td.is-how { margin-top: 6px; }
  .ih-features td.is-how::before { content: "作りの工夫"; display: block; font-size: 12px; font-weight: 700; color: #8E5513; }
  .ih-main .ih-usage__cases a, .ih-main .ih-related__list a { grid-template-columns: 1fr; }
  .ih-used__list { grid-template-columns: 1fr; }
}

/* スマホの概要表は、見出しを上・中身を下に積む */
@media (max-width: 640px) {
  .ih-sheet__table, .ih-sheet__table tbody, .ih-sheet__table tr, .ih-sheet__table th, .ih-sheet__table td { display: block; width: auto; }
  .ih-sheet__table tr { padding: 12px 0; border-bottom: 1px solid var(--ih-rule); }
  .ih-sheet__table tr:last-child { border-bottom: 0; }
  .ih-sheet__table th, .ih-sheet__table td { border: 0; padding: 0; }
  .ih-sheet__table th { font-size: 13px; color: var(--ih-muted); margin-bottom: 2px; }
  .ih-sheet .w-techlist div, .ih-sheet .w-periods li { grid-template-columns: 8.5em minmax(0, 1fr); }
}
