﻿/* ============================================================
   eMedi (PHA) Modern UI Stylesheet
   ------------------------------------------------------------
   Tailwind CSS (css/tailwind.css) と併用するモダンUIテーマ。
   旧 global.css / layouts.css / master.css で定義されていた
   レガシークラス名をすべて再定義しているため、既存ページの
   マークアップを変更せずに全ページへ適用されます。
   モバイル（〜767px）ではフォームテーブルを縦積みに変換します。
   ============================================================ */

/* ------------------------------------------------------------
   1. Design tokens
   ------------------------------------------------------------
   申込フォーム(apply.html / apply-start.html)と同じ
   J Medical ブランドのデザイントークン。
   ink #152a4a / deep #0b1f3a / paper #f7f4ed / pink #df2867 / mint #dfe7f2
   ------------------------------------------------------------ */
@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@400;500;600;700&family=Shippori+Mincho:wght@500;600;700&display=swap');

:root {
    --c-primary: #df2867;         /* pink   (フォームのCTA色) */
    --c-primary-strong: #c41f57;  /* pink-d */
    --c-primary-soft: #dfe7f2;    /* mint   (薄い青灰の面) */
    --c-primary-border: rgba(21, 42, 74, 0.17);
    --c-accent: #b89a68;          /* gold   */
    --c-bg: #ffffff;              /* white  */
    --c-surface: #ffffff;
    --c-border: rgba(21, 42, 74, 0.17);   /* line */
    --c-border-strong: rgba(21, 42, 74, 0.34);
    --c-text: #152a4a;            /* ink    */
    --c-text-strong: #0b1f3a;     /* deep   */
    --c-muted: #6a7a91;           /* muted  */
    --c-label-bg: #f4f6fa;        /* mintの更に薄い面 */
    --c-danger: #dc2626;
    --c-success: #0f6e56;
    --radius: 8px;
    --radius-sm: 8px;
    --shadow-card: none;
    --shadow-header: none;
    --font-sans: 'Noto Sans JP', "Helvetica Neue", Arial, "Hiragino Kaku Gothic ProN", "Hiragino Sans", "Yu Gothic UI", "Meiryo", sans-serif;
    --font-serif: 'Shippori Mincho', "Hiragino Mincho ProN", "Yu Mincho", serif;
}

/* ------------------------------------------------------------
   2. Base
   ------------------------------------------------------------ */
html {
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    padding: 0;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.65;
    color: var(--c-text);
    background-color: var(--c-bg);
}

img {
    max-width: 100%;
    height: auto;
    border: 0;
}

a {
    color: var(--c-primary);
    text-decoration: none;
}

a:hover {
    color: var(--c-primary-strong);
    text-decoration: underline;
}

h1 {
    font-family: var(--font-sans);
    font-size: 1.5rem;
    font-weight: 700;
    color: var(--c-text-strong);
    line-height: 1.4;
    margin: 0.75em 0 0.5em;
}

h2 {
    font-family: var(--font-sans);
    font-size: 1.2rem;
    font-weight: 700;
    color: var(--c-primary-strong);
    line-height: 1.4;
    margin: 0.75em 0 0.5em;
}

h3 {
    font-family: var(--font-sans);
    font-size: 1.05rem;
    font-weight: 700;
    color: var(--c-text-strong);
}

p {
    font-family: var(--font-sans);
}

td, th {
    font-family: var(--font-sans);
    font-size: 14px;
    text-align: left;
    padding: 8px 10px;
}

/* ------------------------------------------------------------
   3. Form controls
   ------------------------------------------------------------ */
input[type="text"],
input[type="password"],
input[type="email"],
input[type="tel"],
input[type="number"],
input[type="date"],
select,
textarea {
    font-family: var(--font-sans);
    font-size: 16px; /* 16px以上でiOSの自動ズームを防止 */
    color: var(--c-text);
    background-color: var(--c-surface);
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    min-height: 42px;
    max-width: 100%;
    box-sizing: border-box;
    outline: none;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

select {
    background-image: url("data:image/svg+xml;charset=utf-8,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath fill='none' stroke='%2364748b' stroke-width='2' stroke-linecap='round' stroke-linejoin='round' d='M1 1.5 6 6.5l5-5'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 10px center;
    padding-right: 32px;
}

input[type="text"]:focus,
input[type="password"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="number"]:focus,
input[type="date"]:focus,
select:focus,
textarea:focus {
    border-color: var(--c-primary);
    box-shadow: 0 0 0 3px rgba(79, 70, 229, 0.18);
}

input[type="radio"],
input[type="checkbox"] {
    width: 20px;
    height: 20px;
    accent-color: var(--c-primary);
    vertical-align: middle;
    margin: 2px 4px 2px 2px;
}

input[type="radio"] + label,
input[type="checkbox"] + label {
    vertical-align: middle;
    cursor: pointer;
    padding: 2px 4px;
}

input[type="submit"],
input[type="button"],
button {
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 600;
    color: #ffffff;
    background-color: var(--c-primary);
    border: 1px solid var(--c-primary);
    border-radius: var(--radius-sm);
    padding: 10px 22px;
    min-height: 44px;
    cursor: pointer;
    transition: background-color 0.15s ease, box-shadow 0.15s ease;
    -webkit-appearance: none;
    appearance: none;
}

input[type="submit"]:hover,
input[type="button"]:hover,
button:hover {
    background-color: var(--c-primary-strong);
    box-shadow: 0 2px 8px rgba(55, 48, 163, 0.35);
}

input[type="submit"]:active,
input[type="button"]:active,
button:active {
    transform: translateY(1px);
}

textarea {
    min-height: 80px;
    line-height: 1.6;
}

/* ------------------------------------------------------------
   4. App shell（マスターページ共通レイアウト）
   ------------------------------------------------------------ */
.app-shell {
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.app-header {
    position: sticky;
    top: 0;
    z-index: 50;
    background-color: rgba(255, 255, 255, 0.96);
    border-bottom: 1px solid var(--c-border);
    box-shadow: var(--shadow-header);
    backdrop-filter: blur(6px);
}

.app-header-inner {
    max-width: none;
    margin: 0 auto;
    padding: 10px 16px;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px 16px;
}

.app-brand {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-right: auto;
}

.app-logo {
    height: 40px;
    width: auto;
    display: block;
}

.app-brand-badge {
    display: inline-block;
    font-size: 11px;
    font-weight: 700;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    color: #ffffff;
    background-color: #df2867;
    border: 1px solid #df2867;
    border-radius: 999px;
    padding: 2px 10px;
}

/* --- Navigation --- */
.nav-toggle {
    display: none;
    flex-direction: column;
    justify-content: center;
    gap: 4px;
    width: 44px;
    height: 44px;
    min-height: 44px;
    padding: 10px;
    background-color: transparent;
    border: 1px solid var(--c-border-strong);
    border-radius: var(--radius-sm);
    cursor: pointer;
}

.nav-toggle:hover {
    background-color: var(--c-label-bg);
    box-shadow: none;
}

.nav-toggle-bar {
    display: block;
    height: 2px;
    width: 100%;
    background-color: var(--c-text);
    border-radius: 2px;
}

.site-nav {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 2px;
}

.nav-group {
    display: contents;
}

a.nav-link {
    display: inline-flex;
    align-items: center;
    font-size: 14px;
    font-weight: 600;
    color: var(--c-text);
    padding: 9px 12px;
    border-radius: var(--radius-sm);
    text-decoration: none;
    white-space: nowrap;
}

a.nav-link:hover {
    color: var(--c-primary);
    background-color: #f2f5f9;
    text-decoration: none;
}

a.nav-link-lang {
    color: var(--c-accent);
}

a.nav-link-logout {
    color: var(--c-danger);
}

a.nav-link-logout:hover {
    color: var(--c-danger);
    background-color: #fef2f2;
}

span.nav-user {
    display: inline-flex;
    align-items: center;
    font-size: 12px;
    font-weight: 600;
    color: var(--c-muted);
    background-color: var(--c-label-bg);
    border: 1px solid var(--c-border);
    border-radius: 999px;
    padding: 4px 12px;
    margin-left: 4px;
}

.site-nav-dense a.nav-link {
    font-size: 13px;
    padding: 7px 9px;
}

/* --- Main --- */
.app-main {
    flex: 1;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    padding: 24px 20px 48px;
    box-sizing: border-box;
}

/* --- Footer --- */
.app-footer {
    background-color: var(--c-surface);
    border-top: 1px solid var(--c-border);
    margin-top: auto;
}

.app-footer-inner {
    max-width: none;
    margin: 0 auto;
    padding: 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px 24px;
}

.footer-link {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-muted);
}

.footer-link:hover {
    color: var(--c-primary);
}

.footer-copy {
    font-size: 12px;
    color: var(--c-muted);
    margin: 0;
    text-align: center;
}

/* ------------------------------------------------------------
   5. ページタイトル・汎用
   ------------------------------------------------------------ */
#pageTitle {
    text-align: center;
    font-weight: bolder;
}

.Required {
    color: var(--c-danger);
    font-weight: 700;
}

.Message {
    text-align: center;
    background-color: var(--c-primary-soft);
    border: 1px solid var(--c-primary-border);
    border-radius: var(--radius-sm);
    color: var(--c-primary-strong);
    padding: 10px 14px;
}

.Box {
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    background-color: var(--c-surface);
}

.Button {
    text-align: center;
    background-color: transparent;
    padding: 14px 10px;
}

.NoBorder td {
    border: 0;
}

/* ------------------------------------------------------------
   6. フォームテーブル（申込・登録・問診）
   ------------------------------------------------------------ */
#regTable,
.formTable,
.formTableRS,
.formTablePL,
.formTableComment,
.boxTable,
#PLTable,
#PLTable3 {
    width: 100%;
    max-width: 960px;
    margin: 0 auto 20px;
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    text-align: center;
    padding: 0;
}

#regTable td, #regTable th,
.formTable td, .formTable th,
.formTableRS td, .formTableRS th,
.formTablePL td, .formTablePL th,
.formTableComment td, .formTableComment th,
.boxTable td, .boxTable th,
#PLTable td, #PLTable th,
#PLTable3 td, #PLTable3 th {
    border: 0;
    border-bottom: 1px solid var(--c-border);
    padding: 10px 12px;
    background-color: var(--c-surface);
}

#regTable tr:last-child td,
.formTable tr:last-child td,
.formTableRS tr:last-child td,
.formTablePL tr:last-child td,
.formTableComment tr:last-child td,
.boxTable tr:last-child td,
#PLTable tr:last-child td,
#PLTable3 tr:last-child td {
    border-bottom: 0;
}

/* セクション見出し行 */
.regTitle {
    background-color: var(--c-primary-soft) !important;
    color: var(--c-primary-strong);
    text-align: left !important;
    font-weight: 700;
    font-size: 15px;
    border-bottom: 1px solid var(--c-primary-border) !important;
    padding: 12px 14px !important;
    width: auto;
}

.LoginBoxHead {
    background-color: var(--c-primary-soft) !important;
    color: var(--c-primary-strong);
    text-align: center !important;
    font-weight: 700;
    font-size: 15px;
    border: 0 !important;
    border-bottom: 1px solid var(--c-primary-border) !important;
    padding: 12px 14px !important;
}

/* ラベルセル */
.regItemLabel,
.QItemLabel,
.FHLabel,
.AHLabel,
.RSLabel,
.PMLabel,
.LSLabel,
.PrintItemLabel {
    background-color: var(--c-label-bg) !important;
    color: var(--c-muted);
    font-weight: 600;
    text-align: right;
    padding-right: 12px;
    vertical-align: middle;
}

.regItemLabelHeader {
    background-color: var(--c-label-bg) !important;
    font-weight: 600;
    text-align: center;
}

.regItemLabelSection {
    background-color: var(--c-primary-soft) !important;
    color: var(--c-primary-strong);
    text-align: left;
    font-weight: 700;
}

/* 入力セル */
.regItemField,
.regItemField56,
.regItemField116,
.regItemField166,
.regItemFieldCenter,
.regItemFieldPM,
.QItemField,
.RSItem,
.PMItem,
.AHItem {
    background-color: var(--c-surface);
    vertical-align: middle;
}

.regItemFieldCenter,
.regItemFieldPM {
    text-align: center;
}

/* 問診（RS）チェックリスト */
.RSCheckField {
    vertical-align: middle;
    text-align: center;
    width: 36px;
    background-color: var(--c-surface);
}

.RSItemField {
    vertical-align: middle;
    background-color: var(--c-surface);
    font-size: 14px;
}

.RSPItemField {
    background-color: var(--c-surface);
}

/* ------------------------------------------------------------
   7. データグリッド（一覧・レポート）
   ------------------------------------------------------------ */
.grdRecord,
.gridFormTable,
.gridBoxTable,
.SearchResultGrid,
.PHAStatusGrid,
#AgingTable,
#lsRefTable,
.recForm {
    width: 100%;
    max-width: 100%;
    margin: 0 auto 20px;
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--shadow-card);
    overflow: hidden;
    text-align: center;
}

.grdRecord th,
.gridFormTable th,
.gridBoxTable th,
.SearchResultGrid th,
.PHAStatusGrid th,
#AgingTable th {
    background-color: var(--c-primary-soft);
    color: var(--c-primary-strong);
    font-weight: 700;
    text-align: center;
    border: 0;
    border-bottom: 1px solid var(--c-primary-border);
    padding: 10px 12px;
}

.grdRecord td,
.gridFormTable td,
.gridBoxTable td,
.SearchResultGrid td,
.SearchGrid td,
.PHAStatusGrid td,
#AgingTable td,
#lsRefTable td,
.recForm td {
    border: 0;
    border-bottom: 1px solid var(--c-border);
    padding: 9px 12px;
    background-color: var(--c-surface);
}

.gridFormTable td,
.gridBoxTable td {
    text-align: right;
}

#AgingTable td,
.PHAStatusGrid td,
.SearchGrid td {
    text-align: center;
}

.grdRecord tr:last-child td,
.gridFormTable tr:last-child td,
.gridBoxTable tr:last-child td,
.SearchResultGrid tr:last-child td,
.PHAStatusGrid tr:last-child td,
#AgingTable tr:last-child td,
#lsRefTable tr:last-child td,
.recForm tr:last-child td {
    border-bottom: 0;
}

/* GridViewの交互行 */
.SearchResultGrid tr:nth-child(even) td,
.grdRecord tr:nth-child(even) td,
#AgingTable tr:nth-child(even) td {
    background-color: var(--c-label-bg);
}

.viewHistoryHeader {
    background-color: var(--c-primary-soft) !important;
    color: var(--c-primary-strong);
    text-align: center;
    font-weight: 700;
}

/* ------------------------------------------------------------
   8. メニュー（患者・スタッフ・管理者）
   ------------------------------------------------------------ */
#MenuItem {
    margin: 0 auto;
    border-collapse: separate;
    border-spacing: 0 10px;
    width: 100%;
    max-width: 520px;
}

#MenuItem th {
    text-align: center;
    border: 0;
    padding: 12px 16px;
    background-color: var(--c-primary);
    color: #ffffff;
    font-weight: 700;
    font-size: 15px;
    border-radius: var(--radius-sm);
    vertical-align: middle;
}

#MenuItem td {
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
    vertical-align: middle;
    padding: 14px 18px;
    text-align: left;
    font-size: 15px;
    transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

#MenuItem td:hover {
    border-color: var(--c-primary-border);
    box-shadow: 0 2px 10px rgba(67, 56, 202, 0.15);
}

#MenuItem td a {
    display: block;
    font-weight: 600;
}

/* ------------------------------------------------------------
   9. プラン選択（PackageSelection）
   ------------------------------------------------------------ */
.PackagePanel {
    margin-top: 14px;
}

.PackageBox {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    border-collapse: separate;
    border-spacing: 0;
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.PackageBox td {
    border: 0;
    border-bottom: 1px solid var(--c-border);
    padding: 8px 10px;
}

.PackageBox tr:last-child td {
    border-bottom: 0;
}

.MatrixItem {
    color: #ea580c; /* orange-600 */
    font-weight: 700;
    text-align: center;
    padding: 2px 6px;
}

td.GeneralMatrixCategoryHeader,
.MatrixHeader {
    text-align: center;
    font-weight: 600;
    background-color: var(--c-label-bg);
}

.PlainCell {
    border: none !important;
    padding: 0 !important;
}

.MatrixPrice td {
    text-align: center;
    padding: 2px 8px;
}

.PackageSelection {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--c-primary-soft);
    border: 1px solid var(--c-primary-border);
    border-radius: var(--radius-sm);
    padding: 10px 12px;
    box-sizing: border-box;
}

.OptionTitle {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    background-color: var(--c-primary-soft);
    color: var(--c-primary-strong);
    font-weight: 700;
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    box-sizing: border-box;
}

.DateSelection {
    width: 100%;
    max-width: 960px;
    margin: 0 auto;
    text-align: center;
    background-color: var(--c-primary-soft);
    border-radius: var(--radius-sm);
    padding: 8px 12px;
    box-sizing: border-box;
}

/* ------------------------------------------------------------
   10. 支払い（Payment）
   ------------------------------------------------------------ */
.PriceLabel {
    background-color: var(--c-surface);
    text-align: left;
    width: 60%;
}

.PriceLabelFooter {
    background-color: var(--c-primary-soft);
    color: var(--c-primary-strong);
    font-weight: 700;
    text-align: left;
    width: 60%;
}

.PriceField {
    background-color: var(--c-surface);
    text-align: right;
    width: auto;
    font-variant-numeric: tabular-nums;
}

.PriceFieldFooter {
    background-color: var(--c-primary-soft);
    color: var(--c-primary-strong);
    font-weight: 700;
    text-align: right;
    width: auto;
    font-variant-numeric: tabular-nums;
}

/* ------------------------------------------------------------
   11. カレンダー
   ------------------------------------------------------------ */
.Cal {
    margin: 10px;
    background-color: var(--c-surface);
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-card);
}

.CalHeader td {
    text-align: center;
    border-style: none;
    font-size: large;
    color: #ffffff;
}

/* ------------------------------------------------------------
   12. LS（生活習慣）
   ------------------------------------------------------------ */
#lsRefTable {
    max-width: 560px;
}

.LSItem td {
    width: 50px;
}

/* ------------------------------------------------------------
   13. 印刷用（既存レイアウトを維持しつつ軽くモダン化）
   ------------------------------------------------------------ */
.PrintTitle {
    text-align: center;
    font-weight: bold;
    width: 620px;
}

.PrintSecTitle {
    background-color: #eeeeee;
    text-align: center;
    width: 620px;
}

#PrintTable,
#PrintTablePayment,
#PrintTableReport,
.PrintTable {
    border-collapse: collapse;
    width: 620px;
}

#PrintTable td,
#PrintTablePayment td,
#PrintTableReport td,
.PrintTable td {
    border: solid 1px #cccccc;
    border-collapse: collapse;
}

/* ------------------------------------------------------------
   14. その他既存クラス
   ------------------------------------------------------------ */
#ContactList {
    text-align: center;
}

.Office {
    display: inline-block;
    text-align: left;
    width: 100%;
    max-width: 520px;
    margin-top: 24px;
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    box-sizing: border-box;
}

#PrivacyContent {
    width: 100%;
    max-width: 680px;
    margin: 0 auto;
    text-align: left;
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px 24px;
    box-sizing: border-box;
}

.PLItem {
    text-align: center;
    background-color: var(--c-surface);
    border: 0;
    border-bottom: 1px solid var(--c-border);
}

.PLSecTitle {
    text-align: center;
    background-color: var(--c-primary-soft);
    color: var(--c-primary-strong);
    font-weight: 700;
    border: 0;
    border-bottom: 1px solid var(--c-primary-border);
}

.PLSecSubTitle {
    text-align: center;
    background-color: var(--c-label-bg);
    border: 0;
    border-bottom: 1px solid var(--c-border);
}

.PLSave {
    text-align: center;
}

.FHItemHeader {
    width: 5%;
    text-align: center;
    background-color: var(--c-label-bg);
    font-weight: 600;
}

.FHItemHeaderObsolete {
    width: 5%;
    text-align: center;
    background-color: #eeeeee;
}

.FHItem {
    width: 5%;
    text-align: center;
    color: var(--c-danger);
    font-weight: bold;
}

/* ------------------------------------------------------------
   15. カード・ボタン等の新ユーティリティ
   ------------------------------------------------------------ */
.card {
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 20px 24px;
}

.page-heading {
    text-align: center;
    font-size: 1.4rem;
    font-weight: 700;
    color: var(--c-text-strong);
    margin: 8px 0 20px;
}

.form-note {
    font-size: 13px;
    color: var(--c-muted);
}

/* ------------------------------------------------------------
   15b. ログイン画面
   ------------------------------------------------------------ */
.login-page {
    max-width: 480px;
    margin: 0 auto;
    text-align: center;
    padding: 8px 0 24px;
}

.login-logo {
    width: 132px;
    height: auto;
    margin: 8px auto 4px;
}

.login-inst {
    font-size: 13px;
    color: var(--c-muted);
    text-align: left;
    background-color: var(--c-primary-soft);
    border: 1px solid var(--c-primary-border);
    border-radius: var(--radius-sm);
    padding: 10px 14px;
    margin: 16px 0 20px;
}

.login-box {
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    overflow: hidden;
    text-align: left;
}

.login-box-head {
    background-color: var(--c-primary);
    color: #ffffff;
    font-size: 16px;
    font-weight: 700;
    text-align: center;
    padding: 14px 16px;
}

.login-box-body {
    padding: 20px 24px 24px;
}

.login-field {
    margin-bottom: 16px;
}

.login-label {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--c-muted);
    margin-bottom: 4px;
}

.login-field input[type="text"],
.login-field input[type="password"] {
    width: 100%;
}

.login-fail {
    display: block;
    color: var(--c-danger);
    font-size: 13px;
    text-align: center;
    margin: 4px 0 8px;
}

.login-field .login-fail {
    text-align: left;
    margin: 4px 0 0;
}

.login-box-body input[type="submit"] {
    width: 100%;
}

.login-links {
    display: flex;
    justify-content: center;
    align-items: center;
    flex-wrap: wrap;
    gap: 6px 12px;
    margin: 18px 0;
    font-size: 14px;
}

.login-links-sep {
    color: var(--c-border-strong);
}

/* ------------------------------------------------------------
   15c. 会員登録（家族情報コピー）
   ------------------------------------------------------------ */
.family-copy-block {
    max-width: 960px;
    margin: 0 auto 20px;
    text-align: left;
}

a.family-copy-link {
    display: inline-block;
    font-size: 14px;
    font-weight: 600;
    padding: 6px 2px;
}

.family-copy-panel {
    background-color: var(--c-surface);
    border: 1px solid var(--c-border);
    border-radius: var(--radius);
    box-shadow: var(--shadow-card);
    padding: 16px 20px;
    margin-top: 8px;
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    gap: 12px 16px;
}

.family-copy-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
    min-width: 180px;
    flex: 1 1 180px;
}

.family-copy-field label {
    font-size: 13px;
    font-weight: 600;
    color: var(--c-muted);
}

.family-copy-panel input[type="submit"],
.family-copy-panel input[type="button"] {
    flex: 0 0 auto;
    width: auto;
}

@media (max-width: 767px) {
    .family-copy-panel input[type="submit"],
    .family-copy-panel input[type="button"] {
        width: 100%;
        max-width: none;
    }
}

/* ------------------------------------------------------------
   16. レスポンシブ（モバイル最適化）
   ------------------------------------------------------------ */
@media (max-width: 767px) {

    body {
        font-size: 15px;
    }

    /* --- ナビゲーション：ハンバーガーメニュー --- */
    .nav-toggle {
        display: flex;
    }

    .site-nav {
        display: none;
        flex-basis: 100%;
        flex-direction: column;
        align-items: stretch;
        gap: 2px;
        padding: 8px 0 4px;
        border-top: 1px solid var(--c-border);
        margin-top: 6px;
    }

    .site-nav.nav-open {
        display: flex;
    }

    a.nav-link {
        display: flex;
        width: 100%;
        box-sizing: border-box;
        padding: 12px 10px;
        font-size: 15px;
        white-space: normal;
    }

    span.nav-user {
        align-self: flex-start;
        margin: 6px 0 4px 10px;
    }

    .app-main {
        padding: 16px 10px 40px;
    }

    /* --- フォームテーブルを縦積みに変換 --- */
    #regTable,
    #regTable > tbody,
    #regTable > tbody > tr,
    .formTable,
    .formTable > tbody,
    .formTable > tbody > tr {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    #regTable > tbody > tr > td,
    #regTable > tbody > tr > th,
    .formTable > tbody > tr > td,
    .formTable > tbody > tr > th {
        display: block;
        width: 100% !important;
        box-sizing: border-box;
        text-align: left;
    }

    /* ラベルセルは項目名ヘッダーとして表示 */
    #regTable .regItemLabel,
    .formTable .regItemLabel {
        background-color: transparent !important;
        border-bottom: 0;
        padding: 12px 12px 2px;
        font-size: 13px;
        color: var(--c-muted);
        text-align: left;
    }

    #regTable .regItemField,
    .formTable .regItemField,
    .formTable .regItemFieldCenter,
    .formTable .regItemFieldPM {
        padding: 2px 12px 12px;
        text-align: left;
    }

    /* 空セル（&nbsp;のみ）による余白を最小化 */
    #regTable td:empty,
    .formTable td:empty {
        display: none;
    }

    /* --- 入力欄をフル幅・タッチしやすく --- */
    #regTable input[type="text"],
    #regTable input[type="password"],
    #regTable textarea,
    .formTable input[type="text"],
    .formTable input[type="password"],
    .formTable textarea,
    .boxTable input[type="text"],
    .boxTable input[type="password"] {
        width: 100% !important;
        min-height: 46px;
    }

    #regTable select,
    .formTable select {
        width: auto !important;
        min-width: 30%;
        max-width: 100%;
        margin-bottom: 4px;
        min-height: 46px;
    }

    input[type="submit"],
    input[type="button"],
    button {
        width: 100%;
        max-width: 420px;
        min-height: 48px;
        font-size: 16px;
    }

    .nav-toggle {
        width: 44px;
        min-height: 44px;
    }

    input[type="radio"],
    input[type="checkbox"] {
        width: 22px;
        height: 22px;
    }

    /* --- 問診チェックリスト（RS）: チェックとラベルを横並びのまま縦積み --- */
    .formTableRS,
    .formTableRS > tbody,
    .formTableRS > tbody > tr {
        display: block;
        width: 100%;
        box-sizing: border-box;
    }

    .formTableRS > tbody > tr > td {
        box-sizing: border-box;
    }

    .formTableRS .RSCheckField {
        display: inline-block;
        width: 40px !important;
        border-bottom: 0;
        vertical-align: middle;
    }

    .formTableRS .RSItemField {
        display: inline-block;
        width: calc(100% - 52px) !important;
        vertical-align: middle;
        border-bottom: 1px solid var(--c-border);
    }

    .formTableRS .RSPItemField,
    .formTableRS .regTitle,
    .formTableRS > tbody > tr > td[colspan] {
        display: block;
        width: 100% !important;
    }

    /* --- データ一覧テーブルは横スクロールで対応 --- */
    .grdRecord,
    .gridFormTable,
    .SearchResultGrid,
    .PHAStatusGrid,
    #AgingTable,
    .PackageBox,
    .formTablePL,
    .formTableComment,
    #PLTable,
    #PLTable3 {
        display: block;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        white-space: nowrap;
    }

    /* --- フッター --- */
    .app-footer-inner {
        flex-direction: column;
        gap: 4px;
        text-align: center;
    }
}

/* ------------------------------------------------------------
   16b. J Medical ブランド調整(申込フォームと同一トーン)
   ------------------------------------------------------------ */
h1, h2 {
    font-family: var(--font-serif);
    font-weight: 600;
    letter-spacing: 0.04em;
}

h2 {
    color: var(--c-text-strong);
}

/* フォームのセクション見出し: mint地 + 濃紺文字 */
.regTitle,
.regItemLabelSection,
.PLSecTitle,
.OptionTitle,
.PriceLabelFooter,
.PriceFieldFooter,
.Message {
    color: var(--c-text-strong);
}

/* データ表のカラム見出し行: 濃紺地 + 白文字 */
.grdRecord th,
.gridFormTable th,
.gridBoxTable th,
.SearchResultGrid th,
.PHAStatusGrid th,
#AgingTable th,
.viewHistoryHeader,
.viewHistoryHeader th,
tr.viewHistoryHeader td {
    background-color: var(--c-text-strong) !important;
    color: #ffffff !important;
    border-color: var(--c-text-strong) !important;
}

.grdRecord th a,
.gridFormTable th a,
.gridBoxTable th a,
.SearchResultGrid th a,
.PHAStatusGrid th a,
#AgingTable th a,
.viewHistoryHeader a {
    color: #ffffff !important;
    text-decoration: none;
}

.grdRecord th a:hover,
.SearchResultGrid th a:hover,
.viewHistoryHeader a:hover {
    color: #f3b1c7 !important;
}

/* タイトル帯: フォームのサマリーバーと同じ濃紺 */
.LoginBoxHead,
#MenuItem th,
.login-box-head {
    background-color: var(--c-text-strong) !important;
    border-color: var(--c-text-strong) !important;
    color: #ffffff;
}

/* ボタン: フォームのCTAと同じ角なし・字間広め */
input[type="submit"],
input[type="button"],
button {
    border-radius: 0;
    letter-spacing: 0.08em;
}

.nav-toggle {
    border-radius: var(--radius-sm);
}

/* ヘッダー: 生成り地の霞ガラス(フォームのsite-headerと同一) */
.app-header {
    background-color: rgba(255, 255, 255, 0.96);
}

/* フッター: フォームと同じ濃紺 */
.app-footer {
    background-color: var(--c-text-strong);
    border-top: 0;
}

.footer-link {
    color: #f3b1c7;
}

.footer-link:hover {
    color: #ffffff;
}

.footer-copy {
    color: rgba(255, 255, 255, 0.7);
}

/* ------------------------------------------------------------
   17. 印刷時はナビ・フッターを非表示
   ------------------------------------------------------------ */
@media print {
    .app-header,
    .app-footer,
    .nav-toggle {
        display: none !important;
    }

    body {
        background-color: #ffffff;
    }

    .app-main {
        padding: 0;
        max-width: none;
    }
}
