﻿/* プロトタイプ用: タブと検索ペインを1段構成に固定 */
    #search {
      gap: 0;
    }

    #search .search-tabs,
    #search .search-pane {
      grid-column: 1 / -1;
    }

    #search .search-tabs {
      align-self: start;
    }

    #search #search-pane-keyword .keyword-search,
    #search #search-pane-ai .conversation-panel {
      margin-top: 0;
    }

    #search #search-pane-keyword .ks-result-list .case-card {
      align-items: center;
    }

    #search #search-pane-keyword .ks-result-list .case-body {
      min-height: 100px;
      display: flex;
      flex-direction: column;
      justify-content: center;
    }

    #search #search-pane-keyword .ks-result-list {
      max-height: 540px;
      overflow-y: auto;
      padding-right: 6px;
    }

    #chat-window .ai-result-block {
      width: 100%;
      max-width: 100%;
      border: 1px solid #d6e6ea;
      border-radius: 10px;
      background: #f7fcfd;
      padding: 12px;
    }

    #chat-window .ai-result-meta {
      margin: 0 0 10px;
      font-size: 0.9rem;
      color: #2a5562;
      font-weight: 700;
    }

    #chat-window .ai-result-list {
      display: grid;
      gap: 8px;
    }

    #chat-window .ai-result-item {
      display: grid;
      grid-template-columns: 58px 1fr;
      gap: 10px;
      align-items: center;
      border: 1px solid #d9e9ed;
      border-radius: 8px;
      background: #fff;
      padding: 8px;
    }

    #chat-window a.ai-result-item {
      text-decoration: none;
      color: inherit;
      transition: box-shadow 0.2s ease, border-color 0.2s ease;
    }

    #chat-window a.ai-result-item:hover {
      border-color: #b8d3dc;
      box-shadow: 0 6px 14px rgba(31, 93, 112, 0.08);
    }

    #chat-window .ai-result-thumb {
      width: 58px;
      height: 58px;
      min-width: 58px;
      border-radius: 6px;
      display: grid;
      place-items: center;
      font-size: 10px;
      color: rgba(255, 255, 255, 0.82);
      text-align: center;
      padding: 4px;
      overflow: hidden;
      box-sizing: border-box;
    }

    #chat-window .ai-result-thumb.deceased-media {
      background:
        linear-gradient(135deg, rgba(151,112,88,0.76), rgba(224,150,111,0.54)),
        repeating-linear-gradient(45deg, #c9a38e 0 12px, #bd9783 12px 24px);
    }

    #chat-window .ai-result-thumb.protected-media {
      background:
        linear-gradient(135deg, rgba(87,121,149,0.78), rgba(118,159,189,0.52)),
        repeating-linear-gradient(45deg, #9db7c9 0 12px, #90aabb 12px 24px);
    }

    #chat-window .ai-result-text {
      min-width: 0;
    }

    #chat-window .ai-result-title {
      margin: 0;
      font-size: 0.95rem;
      font-weight: 700;
      color: #1e3944;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #chat-window .ai-result-sub {
      margin: 3px 0 0;
      font-size: 0.85rem;
      color: #5f7983;
      white-space: nowrap;
      overflow: hidden;
      text-overflow: ellipsis;
    }

    #chat-window .ai-result-guide {
      margin: 10px 0 0;
      font-size: 0.85rem;
      color: #355966;
      line-height: 1.6;
    }

    #chat-window .ai-condition-box {
      margin-bottom: 12px;
      padding: 10px 12px;
      border: 1px solid #d5e7ed;
      border-radius: 12px;
      background: #f7fbfc;
    }

    #chat-window .ai-condition-header {
      display: flex;
      align-items: center;
      justify-content: space-between;
      gap: 10px;
      margin-bottom: 8px;
    }

    #chat-window .ai-condition-label {
      margin: 0;
      font-size: 0.78rem;
      font-weight: 700;
      color: #55717b;
    }

    #chat-window .ai-condition-reset {
      border: 0;
      background: transparent;
      color: #1f7f94;
      padding: 2px 0;
      font-size: 0.78rem;
      font-weight: 700;
      cursor: pointer;
      text-decoration: underline;
      text-underline-offset: 3px;
    }

    #chat-window .ai-condition-reset:hover {
      color: #15596a;
    }

    #chat-window .ai-condition-list {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
    }

    #chat-window .ai-condition-chip {
      border: 1px solid #b9d8e1;
      border-radius: 999px;
      background: #ffffff;
      color: #1f5d70;
      padding: 5px 10px;
      font-size: 0.82rem;
      line-height: 1.2;
      font-weight: 700;
      cursor: pointer;
      transition: background 0.16s ease, border-color 0.16s ease;
    }

    #chat-window .ai-condition-chip:hover {
      background: #eaf5f9;
      border-color: #86bac9;
    }

    #chat-window .ai-result-actions {
      margin-top: 8px;
      display: flex;
      justify-content: flex-end;
    }

    #chat-window .ai-result-actions button {
      border: 1px solid #b8d3dc;
      border-radius: 999px;
      background: #fff;
      color: #1f5d70;
      padding: 6px 12px;
      font-size: 0.85rem;
      font-weight: 700;
      cursor: pointer;
    }

    #chat-window .ai-result-actions button[disabled] {
      opacity: 0.6;
      cursor: wait;
    }

    #chat-window .ai-result-complete {
      margin-top: 8px;
      font-size: 0.85rem;
      color: #6b8791;
      text-align: right;
    }

    #chat-window {
      min-height: 360px;
      height: 360px;
      display: grid;
      grid-auto-rows: min-content;
      align-content: start;
      align-items: start;
      gap: 10px;
      padding: 8px 12px;
      background: transparent;
      border: 0;
      border-radius: 0;
      width: 100%;
      grid-column: 1 / -1;
      overflow-y: auto;
      overflow-x: hidden;
    }

    #chat-window .chat-turn {
      width: 100%;
      display: grid;
      gap: 6px;
      box-sizing: border-box;
    }

    #chat-window .chat-turn.ai {
      justify-items: start;
      position: relative;
      padding-left: 56px;
      min-height: 40px;
    }

    #chat-window .chat-turn.ai::before {
      content: "";
      position: absolute;
      left: 0;
      top: 26px;
      width: 36px;
      height: 36px;
      border-radius: 50%;
      background: #fff url("/img/ai-police-avatar.png") center / cover no-repeat;
      border: 2px solid #fff;
      box-shadow: 0 3px 12px rgba(27, 63, 80, .14);
    }

    #chat-window .chat-turn.user {
      justify-items: end;
    }

    #chat-window .chat-speaker {
      margin: 0;
      font-size: 12px;
      line-height: 1;
      font-weight: 700;
      color: #64828d;
      padding: 0 6px;
    }

    #chat-window .chat-turn.user .chat-speaker {
      text-align: right;
    }

    #chat-window .message {
      align-self: start;
      width: fit-content;
      max-width: 82%;
      border-radius: 18px;
      padding: 12px 16px;
      position: relative;
      overflow: visible;
      box-shadow: 0 3px 10px rgba(27, 63, 80, 0.08);
      font-size: 1.05rem;
      line-height: 1.7;
      box-sizing: border-box;
    }

    #chat-window .message::before,
    #chat-window .message::after {
      content: "";
      position: absolute;
      top: 18px;
      width: 0;
      height: 0;
      border-style: solid;
    }

    #chat-window .message.system {
      justify-self: start;
      background: #eaf5f9;
      color: #24414b;
      border: 1px solid #c8e1ea;
    }

    #chat-window .message.system::after {
      left: -9px;
      border-width: 7px 10px 7px 0;
      border-color: transparent #eaf5f9 transparent transparent;
      z-index: 2;
    }

    #chat-window .message.system::before {
      left: -11px;
      border-width: 8px 11px 8px 0;
      border-color: transparent #c8e1ea transparent transparent;
      z-index: 1;
    }

    #chat-window .message.system.soft {
      background: #eaf5f9;
      color: #44606a;
    }

    #chat-window .message.user {
      justify-self: end;
      background: #ffffff;
      color: #20424d;
      border: 1px solid #b9dbe6;
    }

    #chat-window .message.user::after {
      right: -9px;
      border-width: 7px 0 7px 10px;
      border-color: transparent transparent transparent #ffffff;
      z-index: 2;
    }

    #chat-window .message.user::before {
      right: -11px;
      border-width: 8px 0 8px 11px;
      border-color: transparent transparent transparent #b9dbe6;
      z-index: 1;
    }

    #chat-window .message.result-message {
      max-width: 100%;
      width: 100%;
      border: 0;
      background: transparent;
      box-shadow: none;
      padding: 0;
    }

    #chat-window .message.result-message::after {
      display: none;
    }

    #chat-window .message.result-message::before {
      display: none;
    }

    #chat-window .message p + p {
      margin-top: 6px;
    }

    #chat-window .message p {
      white-space: pre-wrap;
      word-break: break-word;
    }

    #chat-window .message .message-example {
      margin-top: 10px;
      padding: 8px 10px;
      border-radius: 10px;
      background: rgba(255, 255, 255, 0.56);
      border: 1px dashed #b8d4df;
      color: #355965;
      font-size: 13px;
      line-height: 1.6;
    }

    #chat-window .message .message-example::before {
      content: "入力例";
      display: inline-block;
      margin-right: 8px;
      padding: 1px 7px;
      border-radius: 999px;
      background: #d9edf4;
      color: #2d5c69;
      font-size: 11px;
      font-weight: 700;
      vertical-align: 1px;
    }

    #search-pane-ai .chat-input textarea {
      min-height: 92px;
      height: 92px;
      resize: none;
    }

    #search-pane-ai .chat-input button {
      min-height: 92px;
      height: 92px;
    }

    /* 可読性調整: 50代以上を意識して中段コンテンツの文字を拡大 */
    .hero-follow .follow-card span {
      font-size: 15px;
    }

    .hero-follow .follow-card strong {
      font-size: 20px;
      line-height: 1.5;
      text-wrap: balance;
    }

    .hero-follow .follow-card small {
      font-size: 15px;
      line-height: 1.75;
      text-wrap: pretty;
    }

    .mission > p {
      font-size: 1.08rem;
      line-height: 1.9;
      text-wrap: pretty;
      line-break: strict;
    }

    .mission h2,
    .forum-copy h2,
    .section h2,
    .support h2,
    .info-band h2 {
      text-wrap: balance;
      line-height: 1.45;
    }

    .forum-copy p,
    .thread-item strong,
    .section .case-card dl,
    .support p,
    .info-band p {
      font-size: 1.04rem;
      line-height: 1.85;
      text-wrap: pretty;
      line-break: strict;
    }

    .thread-item span,
    .thread-item small {
      font-size: 0.9rem;
    }

    @media (max-width: 760px) {
      .hero-follow .follow-card strong {
        font-size: 18px;
      }

      .hero-follow .follow-card small {
        font-size: 15px;
      }

      .mission > p,
      .forum-copy p,
      .thread-item strong,
      .section .case-card dl,
      .support p,
      .info-band p {
        font-size: 1rem;
      }
    }

    @media (max-width: 760px) {
      #chat-window {
        min-height: 280px;
        height: 280px;
      }
    }

    .info-band.contact-guide {
      grid-template-columns: minmax(0, 1fr) auto;
      grid-template-areas:
        "intro intro"
        "check actions";
      align-items: start;
      row-gap: 14px;
      position: relative;
      overflow: hidden;
      padding: 38px 34px;
      background:
        radial-gradient(1200px 260px at 100% -20%, rgba(255,255,255,0.12), rgba(255,255,255,0) 62%),
        radial-gradient(720px 200px at -10% 120%, rgba(255,255,255,0.1), rgba(255,255,255,0) 62%),
        linear-gradient(145deg, #2f889d 0%, #2a8095 52%, #2b7b90 100%);
    }

    .info-band.contact-guide::after {
      content: "";
      position: absolute;
      right: -84px;
      bottom: -92px;
      width: 260px;
      height: 260px;
      border-radius: 50%;
      border: 1px solid rgba(255, 255, 255, 0.18);
      pointer-events: none;
    }

    .info-band .contact-checklist {
      grid-area: check;
      margin: 0;
      padding-left: 0;
      color: rgba(255, 255, 255, 0.9);
      line-height: 1.8;
      font-size: 1rem;
      list-style: none;
      max-width: 760px;
      align-self: stretch;
    }

    .info-band .contact-intro {
      grid-area: intro;
    }

    .info-band .contact-checklist li + li {
      margin-top: 8px;
    }

    .info-band .contact-checklist li {
      position: relative;
      padding: 10px 11px 10px 34px;
      border-radius: 8px;
      background: rgba(255, 255, 255, 0.08);
      border: 1px solid rgba(255, 255, 255, 0.22);
      min-height: 48px;
      display: flex;
      align-items: center;
    }

    .info-band .contact-checklist li::before {
      content: "";
      position: absolute;
      left: 12px;
      top: 50%;
      transform: translateY(-50%);
      width: 7px;
      height: 7px;
      border-radius: 50%;
      background: #d7f3ff;
      box-shadow: 0 0 0 4px rgba(215, 243, 255, 0.18);
    }

    .info-band .contact-actions {
      grid-area: actions;
      display: grid;
      grid-template-rows: 1fr 1fr;
      gap: 12px;
      justify-items: end;
      align-content: space-between;
      align-self: stretch;
      position: relative;
      z-index: 1;
      padding: 14px;
      border-radius: 12px;
      background: rgba(12, 82, 102, 0.26);
      border: 1px solid rgba(255, 255, 255, 0.2);
      box-shadow: inset 0 1px 0 rgba(255,255,255,0.16);
      min-width: 242px;
    }

    .info-band .contact-actions .button-secondary {
      min-width: 210px;
      width: 100%;
      text-align: center;
      min-height: 0;
      height: 100%;
      display: inline-flex;
      align-items: center;
      justify-content: center;
      padding: 0 22px;
      border-radius: 10px;
      font-size: 1rem;
      font-weight: 800;
      letter-spacing: 0.02em;
      border: 1px solid rgba(255, 255, 255, 0.7);
      color: #ffffff;
      background: rgba(255, 255, 255, 0.08);
      box-shadow: 0 8px 18px rgba(7, 41, 52, 0.2);
      transition: box-shadow 0.2s ease, background 0.2s ease;
    }

    .info-band .contact-actions .button-secondary:hover {
      background: rgba(255, 255, 255, 0.14);
      box-shadow: 0 12px 24px rgba(7, 41, 52, 0.26);
    }

    .info-band .contact-actions .button-secondary:first-child {
      background: #ffffff;
      color: #1d6f84;
      border-color: #ffffff;
      box-shadow: 0 10px 22px rgba(5, 33, 44, 0.24);
    }

    .info-band .contact-actions .button-secondary:first-child:hover {
      background: #f2fbff;
      color: #165c6f;
    }

    .info-band .contact-actions .button-secondary:last-child {
      border-color: rgba(255, 255, 255, 0.8);
      background: rgba(14, 93, 114, 0.28);
    }

    @media (max-width: 980px) {
      .info-band.contact-guide {
        grid-template-columns: 1fr;
        grid-template-areas:
          "intro"
          "check"
          "actions";
      }

      .info-band .contact-actions {
        justify-items: start;
        align-content: start;
        grid-template-rows: auto;
      }

      .info-band .contact-actions .button-secondary {
        width: auto;
        min-height: 54px;
        height: auto;
      }
    }

    /* ── badge 幅統一 ── */
    .badge {
      width: 88px;
      align-self: flex-start;
      justify-content: center;
      text-align: center;
    }

    /* ── mission section ── */
    .mission {
      margin: 56px 0 48px 0;
      padding: 32px 32px;
      background: var(--surface, #fff);
      border-radius: 8px;
      box-shadow: var(--shadow, 0 16px 40px rgba(32,88,104,0.08));
      border: none;
      display: block;
    }
    .mission .mission-heading {
      margin: 0;
      font-size: clamp(24px, 3vw, 34px);
      line-height: 1.35;
      font-weight: 700;
      color: var(--text, #243238);
    }
    .mission > p {
      margin: 0;
      font-size: 1rem;
      line-height: 2.0;
      color: var(--muted, #66777f);
      white-space: pre-line;
    }
    @media (max-width: 720px) {
      .mission {
        padding: 24px 18px;
      }
    }


    #chat-window .ai-result-actions {
      gap: 8px;
      align-items: center;
      flex-wrap: wrap;
    }

    #chat-window .ai-result-search-link {
      border: 1px solid #1f7f94;
      border-radius: 999px;
      background: #1f7f94;
      color: #fff;
      padding: 6px 12px;
      font-size: 0.85rem;
      font-weight: 700;
      text-decoration: none;
    }

    #chat-window .ai-result-thumb img {
      width: 100%;
      height: 100%;
      object-fit: cover;
      border-radius: inherit;
      display: block;
    }

    #chat-window .ai-result-thumb:has(img) {
      padding: 0;
      background: #eef5f7;
    }
