:root {
  font-size: 18px;
  line-height: 1.6;
  letter-spacing: 0.05em;
  color-scheme: light;
}

body {
  /* font-family: "Noto Sans JP", sans-serif; */
  font-family: sans-serif;
  line-height: 1.5;
  color: #1F2937;
  background-color: #f9f9f9;
  margin: 0;
}

*:focus {
  outline: 3px solid #ff9900;
  outline-offset: 3px;
}

::placeholder {
  color: #888;
}

button,
a,
div {
  -webkit-tap-highlight-color: transparent;
}

/* ----- 共通 ----- */
.textcenter {
  display: flex;
  justify-content: center;
  align-items: center;
  text-align: center;
}

.push_action {
  user-select: none;
  transition: transform 0.1s ease, box-shadow 0.2s ease;
  cursor: pointer;
}

.push_action:active {
  transform: scale(0.95);
}

/* ブロック */
.block {
  border: none;
  background-color: #FFF8F1;
  border-radius: 10px;
  color: #1F2937;
  max-width: 600px;
  width: 95%;
  padding: 1rem 1.2rem;
  margin: 1rem auto;
  overflow: hidden;
  box-sizing: border-box;
  box-shadow: 0 3px 10px rgba(0, 0, 0, 0.06);
}

/* ブロックヘッダー */
.block-header {
  font-size: clamp(1.4rem, 3vw, 1.6rem);
  font-weight: 600;
  padding: 0.5rem 0.3rem;
  color: #E67E22;
  display: flex;
  align-items: center;
  gap: 0.5rem;
  border-bottom: none;
  margin-bottom: 0.2rem;
  margin-top: unset;
}

/* ブロック本体 */
.block-body {
  padding: 0.8rem 0;
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.section-msg {
  font-size: 1.2rem;
  line-height: 1.6;
  color: #1F2937;
  text-align: left !important;
  padding-left: 0.2rem;
}

.section-msg-small {
  font-size: 1.05rem;
  line-height: 1.2;
  color: #555;
  text-align: left !important;
  padding-left: 0;
  margin-top: 0;
}

/* 入力欄 */
.block select,
.block input[type="text"],
.block-body input,
.block-body select {
  font-size: 1.2rem;
  padding: 0.6rem 0.8rem;
  border-radius: 7px;
  border: 1px solid #ccc;
  background-color: #fff;
  color: #1F2937;
  width: 100%;
  box-sizing: border-box;
}

/* ボタン */
.btn-ok,
.btn-edit,
.btn-self,
.btn-proxy,
.btn-add,
.btn-back {
  font-size: 1.2rem;
  padding: 0.5rem 1rem;
  border-radius: 7px;
  box-sizing: border-box;
  color: #fff;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  gap: 0.5rem;
  min-height: 3rem;
  border: none;
}

.btn-ok,
.btn-edit,
.btn-self,
.btn-proxy {
  width: 100%;
}

.btn-add {
  display: inline-flex !important;
  width: auto !important;
  gap: 0.4rem !important;
  min-width: 8rem;
  align-self: flex-start;
}

.btn-back {
  width: auto !important;
  min-width: 10rem;
  flex-shrink: 1;
}

.btn-add,
.btn-back,
.btn-edit,
.btn-proxy {
  background-color: #6A6A6A;
}

.btn-ok,
.btn-self {
  background-color: #388E3C;
}

.ppdel,
.petdel {
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background-color: #FFF8F1;
  border: none;
  color: #b00020;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-left: 0.7rem;
  cursor: pointer;
  padding: 0.6rem;
}

.ppdel i,
.petdel i {
  font-size: 1.2rem;
  transform: translateY(-1px);
}

/* スマホ調整 */
@media (max-width: 600px) {
  .facility-header {
    flex-direction: column;
    align-items: flex-start;
  }
}

/* エラー表示 */
#candidate_err,
#manual_err,
#ninzu_err,
#pet_err {
  color: #b00020;
  font-size: 1.1rem;
}

.modal-overlay{
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.55);
  padding: 16px;
  box-sizing: border-box;
  display: flex;
  align-items: flex-start;
  justify-content: center;
}

.modal-card{
  width: 100%;
  min-height: calc(100vh - 32px);
  background: #f7f4ee;
  border-radius: 16px;
  box-sizing: border-box;
  padding: 32px 24px 24px;
  margin-top: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
}

.modal-card h3{
  margin: 0 0 24px;
  font-size: 1.6rem;
  line-height: 1.4;
}

.modal-text{
  margin: 0 0 32px;
  font-size: 1.2rem;
  line-height: 1.8;
}

#gpsStartBtn {
  min-height: 3.5rem;
  line-height: 1.4;
}

@media (min-width: 600px) {
  .modal-overlay {
    padding: 24px;
  }

  .modal-card {
    max-width: 640px;
    min-height: auto;
    padding: 36px 32px 32px;
    margin-top: 32px;
  }
}

/* GPSオーバーレイ */
#gpsOverlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  font-size: 1.3rem;
  font-weight: bold;
  z-index: 1000;
}

/* GPSオーバーレイ */
.spinner {
  font-size: 3rem;
}

#gpsMessage {
  text-align: center;
  margin-top: 0.5rem;
  color: #1F2937;
}

.spinner {
  font-size: 3.5rem;
  margin-bottom: 1.5rem;
  animation: spin 1s linear infinite;
  color: #00796B;
}

@keyframes spin {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

/* 避難所情報 */
.hidden {
  display: none;
}

.section-top {
  margin-top: 1rem;
}

/* その他画面表示用 */
.facility-info {
  max-width: 600px;
  width: 100%;
  margin: 0 auto;
  padding: 0 1rem;
  box-sizing: border-box;
  text-align: left;
  color: #1F2937;
  font-size: 1.1rem;
}

#facilityManual {
  max-width: 600px;
  margin: 0 auto;
  width: 100%;
  position: relative;
  box-sizing: border-box;
  display: none;
}

/* オートコンプリート用 */
#manualInput {
  margin-top: 0.5rem;
}

#manualList {
  margin-bottom: 0.25rem;
  padding-left: 0;
}

.shelter-id {
  font-size: 1.1rem;
  color: #555;
  margin-left: 0.25em;
  white-space: nowrap;
}

.shelter-candidate {
  margin-bottom: 10px;
  margin-top: 10px;
  padding: 14px 16px !important;
}

.shelter-candidate .radio-text {
  text-align:left;
  line-height: 1.5;
  word-break: break-word;
}

.autocomplete-list {
  font-size: 1.2rem;
  border-radius: 7px;
  overflow-y: auto;
  max-height: 200px;
  box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
  background: #fff;
  margin-top: 0.3rem;
  padding: 0;
  width: 100%;
}

.autocomplete-list li {
  padding: 1rem;
  padding-left: 1rem;
  padding-right: 1rem;
  cursor: pointer;
  text-align: left !important;
}

.autocomplete-list li:hover,
.autocomplete-list li.active {
  background: #fcefd9;
  border-left: 4px solid #E67E22;
}

/* select_person_list, select_pet_list */
.section-list {
  display: flex;
  flex-direction: column;
  margin-bottom: 1rem;
  gap: 0.75rem;
}

.person-row,
.pet-row {
  font-size: 1.2rem;
  position: relative;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background-color: #fff;
  border: 1px solid #D5D5D5;
  border-radius: 12px;
  padding: 1rem;
  flex: 1;
  cursor: pointer;
  min-width: 0;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

#personList,
#petList {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.person-container,
.pet-container {
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: space-between;
}

.person-row[data-filled="true"],
.pet-row[data-filled="true"] {
  background-color: #C8E6C9;
  border: 1px solid #D5D5D5;
}

.person-name,
.pet-name {
  flex: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-all;
}

.status-label {
  position: absolute;
  top: -6px;
  left: -6px;
  background-color: #F9A846;
  color: #5A3500;

  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.75rem;

  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

/* input_person_info.html */
/*＝＝＝＝＝ 上部人数表示 ＝＝＝＝＝*/
.ninzu-wrap,
.pet-wrap {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: clamp(1.4rem, 3vw, 1.6rem);
  font-weight: 600;
  padding: 0.5rem 0.5rem;
  margin-bottom: 0.25rem;
  color: #E67E22;
  border-bottom: none;
  padding-bottom: 0;
  margin-top: unset;
}

/*＝＝＝＝＝ ヘッダーとフォーム全体配置 ＝＝＝＝＝*/
.out-block {
  padding: 0.8rem 1rem;
  max-width: 600px;
  margin: 0.5rem auto;
  border-radius: 8px;
  box-sizing: border-box;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-bottom: 0;
}

.form-block {
  background-color: #FFF8F1;
  padding: 0.5rem 0.8rem;
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  max-width: 600px;
  width: 100%;
  box-sizing: border-box;
  margin: 0.5rem auto;
}

/*＝＝＝＝＝ 基本行とラベル ＝＝＝＝＝*/
.form-row {
  display: flex;
  flex-direction: column;
  margin-bottom: 0.35rem;
  margin-top: 0.2rem;
}

.form-label {
  font-size: 1.10rem;
  font-weight: 500;
  color: #7A4E2A;
  margin-bottom: 0.2rem;
  padding-left: 0.2rem;
  margin-top: 0.2rem;
}

/* 必須マーク */
.required {
  background-color: #b00020;
  color: #fff;
  padding: 1px 5px;
  border-radius: 6px;
  font-size: 0.65em;
  margin-left: 6px;
  vertical-align: middle;
  font-weight: bold;
}

/*＝＝＝＝＝ 入力欄（テキスト・セレクト） ＝＝＝＝＝*/
.form-input,
.multi-line {
  border-radius: 7px;
  color: #1F2937;
  border: 1px solid #ccc;
  min-width: 60px;
  width: 100%;
}

input[type="text"],
input[type="tel"],
input[type="number"],
input[type="date"],
input[type="time"],
select,
.form-input,
.multi-line {
  font-size: 1.2rem;
  padding: 0.55rem 0.8rem;
  box-sizing: border-box;
}

.form-input:not([type="radio"]):not([type="checkbox"]) {
  flex: 1;
}

/*＝＝＝＝＝ 氏名入力（姓・名） ＝＝＝＝＝*/
.name-inputs {
  display: flex;
  gap: 0.5rem;
  min-width: 0;
  border: none;
  padding: 0;
}

.name-inputs input {
  font-size: 1.2rem;
  padding: 0.6rem 0.8rem;
  border-radius: 7px;
  color: #1F2937;
  border: 1px solid #ccc;
  flex: 1;
  box-sizing: border-box;
  min-height: 2.6rem;
}

.kana-label {
  color: #b00020;
}

/*＝＝＝＝＝ 生年月日 ＝＝＝＝＝*/
.dob-inputs {
  display: flex;
  flex-direction: column;
  background: #ffffff;
  border: 1px solid #d5d5d5;
  border-radius: 6px;
  padding: 0.5rem 0.6rem;
  box-sizing: border-box;
  gap: 0.3rem;
}

.dob-inputs select {
  padding: 0.55rem 0.5rem;
}

.dob-group {
  display: flex;
  gap: 0.5rem;
}

.dob-group select {
  width: 100%;
}

.dob-month-day {
  display: flex;
  gap: 0.3rem;
}

.dob-month-day select {
  flex: 1;
}

/*＝＝＝＝＝ ラジオ・チェックボックス基礎 ＝＝＝＝＝*/
input[type="radio"],
input[type="checkbox"] {
  flex: 0 !important;
  width: 22px;
  height: 22px;
  cursor: pointer;
}

/*＝＝＝＝＝ ラジオボタン ＝＝＝＝＝*/
.radio-group {
  display: flex;
  flex-direction: column;
  gap: 0.4rem;
}

.radio-group label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.6rem 0.6rem;
  background-color: #fff;
  border: 1px solid #ccc;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #1F2937;
}

.radio-item {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 1rem 0.6rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1.2rem;
  width: 100%;
  box-sizing: border-box;
}

.radio-item span {
  line-height: 1.3;
  display: inline-block;
}

.radio-item input[type="radio"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  margin: 0;
  transform: translateY(-1px);
}

.radio-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.8rem;
}

.radio-group.single-column {
  grid-template-columns: 1fr;
}

/* チェック時の強調 */
/* .radio-item:has(input[type="radio"]:checked) {
  background-color: #FCEFD9;
  border-color: #E67E22;
} */

/*＝＝＝＝＝ チェックボックス ＝＝＝＝＝*/
.checkbox-item,
.optout-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.6rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #1F2937;
  box-sizing: border-box;
  width: 100%;
}

.checkbox-item input[type="checkbox"],
.optout-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  transform: translateY(-1px);
}

.checkbox-group {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.5rem 0.8rem;
}

.checkbox-group.single-column {
  grid-template-columns: 1fr;
}

/* チェック時の強調 */
/* .checkbox-item:has(input[type="checkbox"]:checked), */
.optout-label:has(input[type="checkbox"]:checked) {
  background-color: #FCEFD9;
  border-color: #E67E22;
}

/*＝＝＝＝＝ fieldset（区切り線なし） ＝＝＝＝＝*/
fieldset.form-row {
  border: none;
  padding: 0.2rem 0;
  margin-bottom: 0.8rem;
}

/*＝＝＝＝＝ 区切り ＝＝＝＝＝*/
.section-block {
  background-color: #FFEFDF;
  padding-top: 1.25rem;
  border-top: 1px solid #e5e5e5;
}

/*＝＝＝＝＝ 配慮事項 ＝＝＝＝＝*/
/* need-item は中に label と detail を持つので外枠を整える */
#special_needs_fieldset .need-item > .checkbox-item {
  border-radius: 7px 7px 0 0;
}

/* 詳細ブロック：関連性が分かる見た目 */
#special_needs_fieldset .sub-input {
  padding: 10px 12px 12px;
  background: #fff;
  border-radius: 0 0 7px 7px;
  border: 1px solid #E67E22;
}

/* 子チェック群 */
#special_needs_fieldset .checkbox-subgroup label {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 0;
  font-size: 1rem;
}

#special_needs_fieldset textarea {
  line-height: 1.3;
}

/* 子の“その他入力”は幅を確保 */
#special_needs_fieldset .form-input.inline {
  width: min(480px, 80%);
}

/*＝＝＝＝＝ エラー表示 ＝＝＝＝＝*/
.input-error {
  border: 2px solid #b00020 !important;
  background-color: #fff8f8;
}

.radio-group.input-error {
  border: 2px solid #b00020;
  border-radius: 7px;
  background-color: #fff8f8;
}

.error-message {
  color: #b00020;
  display: block;
  margin-top: 0.25rem;
}

/* 05_confirm.html */
#confirmList {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 人、ペットごとのコンテナ */
.person-confirm,
.pet-confirm {
  display: flex;
  flex-direction: column;
  background-color: #EAF4EA;
  border-radius: 7px;
  padding: 0.5rem 0.7rem;
  border: 1px solid #CBD5E1;
  align-items: start;
}

/* ラベルと値の行 */
.person-confirm p,
.pet-confirm p {
  margin: 0 0 0.5rem 0;
  font-size: 1.17rem;
  text-align: left;
  padding: 0;
}

/* ラベル部分 */
.person-confirm strong,
.pet-confirm strong {
  display: block;
  color: #374151;
  font-weight: 700;
}

.person-confirm span,
.pet-confirm span {
  display: block;
  line-height: 1.45;
  padding-left: 0.3rem;
}

.person-confirm hr {
  border: none;
  border-top: 1px solid #CBD5E1;
  margin: 0.6rem 0;
}

.pet-confirm hr {
  border: none;
  width: 100%;
  height: 1px;
  border-top: 1px solid #CBD5E1;
  margin: 0.5rem 0;
}

/* 退所フォーム専用 */
.person-row[data-exit-ready="true"] {
  background-color: #FFE2A8;
}

.exit-label {
  position: absolute;
  top: -6px;
  right: -6px;
  background-color: #F9A846;
  color: #5A3500;

  padding: 3px 6px;
  border-radius: 6px;
  font-size: 0.75rem;

  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
  white-space: nowrap;
}

.readonly-field {
  background: #F3F4F6 !important;
  padding: 10px 12px !important;
  border-radius: 6px !important;
  font-size: 1.1rem !important;
  border: 1px solid #E5E7EB !important;
  margin-top: 4px !important;
  margin-bottom: 0 !important;
  -webkit-text-fill-color: #111827 !important; /* iOS/Safari対策 */
  opacity: 1 !important;                         /* disabledの薄さ対策 */
}

.exit-ready-label {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  padding: 0.7rem 0.6rem;
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 7px;
  cursor: pointer;
  font-size: 1.2rem;
  color: #1F2937;
  box-sizing: border-box;
  width: 100%;
}

.exit-ready-label input[type="checkbox"] {
  width: 22px;
  height: 22px;
  flex: 0 0 auto;
  transform: translateY(-1px);
}

/* チェック時の強調 */
/* .exit-ready-label:has(input[type="checkbox"]:checked) {
  background-color: #FCEFD9;
  border-color: #E67E22;
} */

/* ペットフォーム専用 */
.facility-change-link {
  font-size: 0.9rem;
  color: #007bff;
  text-decoration: underline;
}

.facility-change-link:hover {
  opacity: 0.8;
}

.multi-paw i {
  position: relative;
  margin-right: 0.45em;
}

.multi-paw i::after {
  content: "\f1b0";
  font-family: "Font Awesome 7 Free";
  font-weight: 900;
  position: absolute;
  left: 0.35em;
  top: 0.25em;
  opacity: 0.75;
  pointer-events: none;
}

.section-title {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 1.10rem;
  font-weight: 500;
}

/*＝＝＝＝＝ 区切り ＝＝＝＝＝*/
.pet-block {
  background-color: #FFEFDF;
  border-top: 1px solid #e5e5e5;

}

.multi-line {
  height: 4.5em;
  padding-top: 8px;
  padding-bottom: 8px;
  line-height: 1.4;
}

.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;
}

/* Android一部端末のselect描画安定化 */
select,
select.form-input {
  min-height: 48px;
  line-height: 1.4;
  color: #1F2937;
  background-color: #fff;
  -webkit-appearance: menulist;
  appearance: auto;
}

select option {
  color: #1F2937;
  background-color: #fff;
}

select,
select.form-input,
select option {
  font-size: 18px;
}

select,
select.form-input {
  position: relative;
  z-index: 1;
}

.form-block,
.form-row,
.dob-inputs {
  overflow: visible;
}

select option {
  min-height: 32px;
  line-height: 1.4;
  padding: 8px;
}

#residence_address {
  color: #0066cc;
}
