:root{
  --bg:#f6f7f9;
  --card:#ffffff;
  --text:#111827;
  --muted:#6b7280;
  --line:#e5e7eb;
  --accent:#2563eb;
  --danger:#dc2626;
  --radius:14px;
}

*{ box-sizing:border-box; }

body{
  margin:0;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Noto Sans JP", "Hiragino Kaku Gothic ProN", Meiryo, sans-serif;
  background:var(--bg);
  color:var(--text);
  line-height:1.6;
}

.wrap{
  max-width: 720px;
  margin: 0 auto;
  padding: 24px 14px 40px;
}

.card{
  background:var(--card);
  border:1px solid var(--line);
  border-radius:var(--radius);
  box-shadow: 0 6px 20px rgba(0,0,0,.04);
  padding: 18px;
}

h1{
  font-size: 1.4rem;
  margin: 0 0 10px 0;
}

.lead{
  margin: 0 0 16px 0;
  color: var(--muted);
  font-size: .95rem;
}

.help{
  font-size: .85rem;
  color: var(--muted);
  margin: 0;
}

/* =========================
   フォーム系
   ========================= */
.form{
  display: grid;
  gap: 14px;
  margin-top: 10px;
}

.field{
  display: grid;
  gap: 6px;
}

.label{
  font-weight: 600;
  font-size: .95rem;
  display:flex;
  align-items:baseline;
  gap:10px;
}

.req{
  font-size: .75rem;
  padding: 2px 8px;
  border-radius: 999px;
  background: rgba(220,38,38,.1);
  color: var(--danger);
  border: 1px solid rgba(220,38,38,.25);
  line-height: 1.4;
}

/* 入力欄（email / password / text を統一） */
input[type="email"],
input[type="password"],
input[type="text"]{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  outline: none;
}

input[type="email"]:focus,
input[type="password"]:focus,
input[type="text"]:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

/* textarea / file を統一 */
textarea{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 1rem;
  background: #fff;
  outline: none;
  resize: vertical;
  min-height: 120px;
}
textarea:focus{
  border-color: rgba(37,99,235,.55);
  box-shadow: 0 0 0 4px rgba(37,99,235,.12);
}

input[type="file"]{
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 12px;
  background: #fff;
}

/* 読み取り表示（メールアドレス表示用） */
.readonly{
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #f9fafb;
  color: var(--text);
  font-size: 1rem;
}

/* 郵便番号＋住所など、まとまり入力 */
.split{
  display: grid;
  gap: 10px;
}

.subfield{
  display: grid;
  gap: 6px;
}

.sublabel{
  font-size: .85rem;
  color: var(--muted);
}

/* チェックボックス行 */
.checkline{
  display: inline-flex;
  gap: 10px;
  align-items: center;
  margin: 4px 0 10px;
  color: var(--text);
  font-size: .95rem;
}
.checkline input{
  width: 18px;
  height: 18px;
}

/* PCは郵便番号と住所を2列に（スマホは縦） */
@media (min-width: 600px){
  .split{
    grid-template-columns: 1fr 2fr;
    align-items: start;
  }
}

/* =========================
   ボタン（a.btn と button を共通化）
   ========================= */
.btn,
button{
  display: inline-flex;
  justify-content: center;
  align-items: center;
  width: 100%;
  text-decoration: none;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 700;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  border: 0;
}

.btn:hover,
button:hover{ filter: brightness(0.97); }

.btn:active,
button:active{ transform: translateY(1px); }

/* サブボタン（戻る/リセットなど） */
.btn-sub{
  background: #ffffff;
  color: var(--text);
  border: 1px solid var(--line);
}
.btn-sub:hover{ background:#f9fafb; }

/* disabled */
button:disabled{
  opacity: .55;
  cursor: not-allowed;
  transform: none;
  filter: none;
}

/* =========================
   actions（ボタン並び：基本は縦）
   ※ 2列にしたいページだけ .two を付ける
   ========================= */
.actions{
  margin-top: 6px;
  display: grid;
  gap: 10px;
}

/* PCで2列にしたいときだけ */
@media (min-width: 600px){
  .actions.two{
    grid-template-columns: 1fr 1fr;
  }
}

/* PCで常に1列にしたい（念のための保険） */
@media (min-width: 600px){
  .actions.wide{
    grid-template-columns: 1fr;
  }
}

/* =========================
   フッター/会社情報
   ========================= */
.foot{
  margin-top: 14px;
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

.company{
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: .9rem;
  text-align: center;
}

/* =========================
   メニュー画面用
   ========================= */
.hello{
  margin: 0 0 6px 0;
  color: var(--muted);
  font-size: .95rem;
}

.menu{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.notice{
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px 14px;
  color: var(--muted);
  font-size: .95rem;
}

/* =========================
   ログイン/アラート
   ========================= */
.alert{
  border: 1px solid rgba(220,38,38,.25);
  background: rgba(220,38,38,.08);
  color: #991b1b;
  border-radius: 12px;
  padding: 10px 12px;
  font-size: .95rem;
  margin: 10px 0 14px;
}

/* =========================
   同意書ページ用
   ========================= */
.docbox{
  margin-top: 10px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 12px;
}

.doc-title{
  font-size: 1.05rem;
  margin: 0 0 8px 0;
}

.doc{
  border-top: 1px solid var(--line);
  margin-top: 10px;
  padding-top: 10px;
  max-height: 52vh;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.doc p{
  margin: 0 0 12px 0;
  color: var(--text);
  font-size: .95rem;
}

.doc-meta{
  color: var(--muted);
  font-size: .9rem;
  margin-top: 8px;
}

.agree-form{ margin-top: 12px; }

/* =========================
   確認画面（review）
   ========================= */
.review{
  display: grid;
  gap: 12px;
  margin-top: 10px;
}

.review-item{
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 12px;
}

.review-label{
  font-size: .85rem;
  color: var(--muted);
  margin-bottom: 6px;
}

.review-value{
  font-size: 1rem;
  color: var(--text);
  word-break: break-word;
}

.muted{ color: var(--muted); }

/* 添付プレビュー */
.preview{
  width: 100%;
  max-width: 420px;
  height: auto;
  display: block;
  border-radius: 12px;
  border: 1px solid var(--line);
}

/* 添付ファイル一覧 */
.attach-info{
  margin-top: 8px;
  font-size: .9rem;
  color: var(--muted);
  word-break: break-all;
}

/* =========================
   修理履歴ページ（ヘッダ）
   ========================= */
.status-bar{
	padding: 0.5rem 2rem;
	background-color: #DD1135;
	font-size: large;
	text-align: center;
	font-weight: bold;
	color: #FFF
}

.meta{
  display: grid;
  gap: 6px;
  color: var(--muted);
  font-size: .95rem;
  margin: 10px 0 14px;
}
.meta b{ color: var(--text); }

/* =========================
   チャットBOX（ユーザー/管理者）
   ========================= */
.box-user,
.box-admin{
  position: relative;
  max-width: 100%;
  padding: 1.5em 1.2em 1.0em;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  color: var(--text);
  word-break: break-word;
}

/* ユーザー側：左寄せ */
.box-user{
  margin: 14px 0 14px 0;
  border-left: 5px solid var(--accent);
  background: #f8fafc;
}

/* 管理者側：右寄せ */
.box-admin{
  margin: 14px 0 14px auto;
  border-left: 5px solid #d7865b;
  background: #fff7f2;
}

/* ラベル（被せ） */
.box-user .box-label,
.box-admin .box-label{
  position: absolute;
  top: -0.75em;
  left: 12px;
  padding: 0.25em 0.6em;
  font-size: 12px;
  line-height: 1;
  color: #fff;
  border-radius: 8px;
  white-space: nowrap;
}
.box-user .box-label{ background: var(--accent); }
.box-admin .box-label{ background: #d7865b; }

/* 添付（チャット内） */
.chat-attach{
  display: grid;
  gap: 6px;
  margin-top: 10px;
}
.chat-attach img{
  width: 84px;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--line);
}
.chat-attach a{
  color: var(--accent);
  text-decoration: none;
  font-size: .95rem;
}
.chat-attach a:hover{ text-decoration: underline; }

/* 見積承諾ボタン */
.btn-mitsumori{
  width: 100%;
  border: 0;
  border-radius: 12px;
  padding: 12px 14px;
  font-size: 1rem;
  font-weight: 800;
  background: #16a34a;
  color: #fff;
  cursor: pointer;
  margin-top: 10px;
}
.btn-mitsumori:hover{ filter: brightness(0.97); }
.btn-mitsumori:active{ transform: translateY(1px); }

/* 送信フォーム */
.chat-form{
  margin-top: 18px;
  display: grid;
  gap: 10px;
}

/* PCの時は余白を少し広く */
@media (min-width: 600px){
  .wrap{ padding: 34px 20px 50px; }
  .card{ padding: 22px; }
  h1{ font-size: 1.55rem; }
}

/* =========================
   このページのトップボタンだけ（他へ影響なし）
   HTML例：
   <div class="actions actions-top">
     <a class="btn btn-top" href="user_top.asp">トップページへ</a>
   </div>
   ========================= */
.actions-top{
  width: 100%;
  text-align: center;
  margin-top: 16px;
}

.actions-top .btn-top{
  display: block;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
}

/* 住所ブロックは「郵便番号1行 → 住所2行目」で縦固定 */
.split-addr{
  display: grid;
  gap: 10px;
}

/* 郵便番号（3桁 + 4桁）を1行に */
.zip-row{
  display: grid;
  grid-template-columns: 1fr auto 1.2fr;
  align-items: center;
  gap: 8px;
}

.zip-sep{
  color: var(--muted);
  font-weight: 700;
}

.zip3{ max-width: 140px; }
.zip4{ max-width: 180px; }

/* 郵便番号を左寄せ（中身幅で並べる） */
.zip-row{
  display: flex;
  justify-content: flex-start; /* 左寄せ */
  align-items: center;
  gap: 8px;
}

/* 郵便番号の入力欄は伸びないように固定幅 */
.zip-row .zip3{
  width: 6.5em;   /* 3桁＋少し余裕 */
  max-width: none;
}
.zip-row .zip4{
  width: 8.5em;   /* 4桁＋少し余裕 */
  max-width: none;
}

/* 送信中ロック（オーバーレイ） */
.submit-lock{
  position: fixed;
  inset: 0;
  z-index: 9999;
  display: none;               /* 初期は非表示 */
  align-items: center;
  justify-content: center;
  background: rgba(17,24,39,.45);
  pointer-events: none;        /* 非表示時はクリック透過 */
}

.submit-lock.is-show{
  display: flex;
  pointer-events: all;         /* 表示時は操作不可にする */
}

.submit-lock__box{
  width: min(92vw, 360px);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 18px 16px;
  box-shadow: 0 10px 30px rgba(0,0,0,.15);
  display: grid;
  gap: 12px;
  justify-items: center;
  text-align: center;
}

.spinner{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  border: 4px solid rgba(37,99,235,.18);
  border-top-color: var(--accent);
  animation: spin 0.9s linear infinite;
}

@keyframes spin{
  to { transform: rotate(360deg); }
}

.submit-lock__text{
  font-weight: 700;
  color: var(--text);
}

.attach-error{
  margin-top:8px;
  padding:10px 12px;
  border-radius:10px;
  border:1px solid #fecaca;
  background:#fee2e2;
  color:#991b1b;
  font-weight:700;
}

/* 機種・OSなどのラジオを縦並びにする */
.radio-group{
  display: flex;
  flex-direction: column;
  gap: 10px;          /* 行間（不要なら調整） */
  align-items: flex-start;
}

/* ラベル全体をクリックしやすく（任意） */
.radio-item{
  display: flex;
  align-items: center;
  gap: 10px;
}

.file-hidden{
  position:absolute;
  left:-9999px;
  width:1px;height:1px;
  overflow:hidden;
}

.attach-btn{
  width:100%;
  padding:14px 16px;
  border-radius:12px;
  border:2px solid #0ea5e9;
  background:#e0f2fe;
  font-weight:700;
  font-size:16px;
  cursor:pointer;
  color:#6b7280; /* ← 追加（グレー） */
  box-shadow:0 6px 16px rgba(14,165,233,.25);
}

.attach-btn:hover{ filter:brightness(.98); }
.attach-btn:active{ transform:translateY(1px); }

.attach-btn.has-file{
  border-color:#22c55e;
  background:#dcfce7;
  color:#374151; 
}

.attach-btn.bad{
  border-color:#ef4444;
  background:#fee2e2;
  color:#7f1d1d;
}

.attach-info{
  margin-top:8px;
  font-size:14px;
  font-weight:600;
}