@charset "UTF-8";

* {
  box-sizing: border-box;
}

body {
  font-family: sans-serif;
  font-size: 16px;
  font-weight: bold;
  margin: 0;
  padding: 0;
  text-align: center;
  background-image: linear-gradient(-30deg, rgb(255, 247, 254), rgb(233, 252, 240));
}

body.modal-open {
  overflow: hidden;
}

.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5em 1em;
}

.header-back,
.header-etc {
  font-size: 1.2rem;
  width: 80px;
  text-align: left;
  opacity: 1;
  visibility: visible;
  transition: opacity 0.5s ease;
}

.header-back.hidden {
  opacity: 0;
  visibility: hidden;
}

.header-back.fade-out {
  opacity: 0;
  pointer-events: none;
  background-color: transparent !important;
  transform: translateX(-100%);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.header-title {
  flex: 1;
  text-align: center;
  font-size: 1.2rem;
  font-weight: bold;
}

.hidden {
  visibility: hidden;
  /* 非表示でも幅は保つ */
}

#back-to-home {
  font-size: 0.8rem;
  text-align: center;
  color: blue;
  cursor: pointer;
  background-color: transparent !important;
  border-radius: 10px;
}

.instruction {
  width: 100%;
  font-size: 0.7rem;
  text-align: center;
  font-weight: normal;
  color: #888888;
  margin: 5px;
}

.guess {
  color: rgb(0, 200, 255);
}

.desc {
  font-size: 0.8rem;
  margin: 10px 30px;
  color: black;
  text-align: center;
}

.warn {
  font-size: 0.8rem;
  margin: 10px 30px;
  color: red;
  text-align: center;
}

.note {
  font-size: 0.7rem;
  margin-top: 10px;
  margin-left: 50px;
  color: rgb(248, 78, 225);
  text-align: left;
}

.notices {
  margin: 60px 30px;
  font-size: 0.8rem;
}

.shadow_frame {
  padding: 1rem 1.5rem;
  margin: 1rem auto;
  border: 1px solid #c7c7c7;
  border-radius: 10px;
  box-shadow: 2px 2px 4px rgb(199, 199, 199);
  background-color: white;
  width: calc(100% - 2rem);
  max-width: 600px;
}

.hidden {
  visibility: hidden;
}

#input_table {
  padding: 0.8rem 0.8rem 0 0.8rem;
  font-size: 0.7rem;
  margin: 0 auto;
  width: 100%;
  max-width: 500px;
}

input::placeholder {
  font-size: 0.8rem;
  text-align: center;
}

input[type=date] {
  font-size: 1rem;
  width: 100%;
  max-width: 100px;
}

input[type=number] {
  font-size: 1rem;
  text-align: right;
  width: 100%;
  max-width: 100px;
}

input[type=text] {
  font-size: 1rem;
}

input[list] {
  font-size: 1rem;
  width: 100%;
  max-width: 100px;
}

.input-unit {
  display: flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}

.input-unit input {
  width: 100%;
  box-sizing: border-box;
}

select::picker(select) {
  appearance: none;
  font-size: 0.9rem;
}

select {
  height: 20pt;
}

.item_title {
  text-align: left;
  vertical-align: bottom;
  font-size: 0.7rem;
  white-space: nowrap;
  overflow: hidden;
  /*text-overflow: ellipsis; 任意：はみ出たら「…」で省略表示 */
}

#warning_message {
  font-size: 9pt;
  color: red;
  margin-top: 10px;
}

#menu_table {
  margin: 0.5rem 1.5rem;
  font-size: 10pt;
  text-decoration: none;
  color: blue;
  width: 90%;
}

#result_table {
  width: 90%;
  margin: 0 auto;
  table-layout: fixed;
}

#result_table td {
  text-align: center;
  font-size: 1.2rem;
  color: red;
  white-space: nowrap;
}

#list_table {
  font-size: 0.8rem;
  box-shadow: 2px 2px 4px rgb(199, 199, 199);
  margin: 0.5rem;
  width: 95%;
}

#list_table th {
  font-weight: normal;
  border-color: gray;
}

#list_table td {
  font-weight: normal;
  text-align: center;
  border-width: 1;
  border-color: gray;
  background-color: white;
}

.goto-btn {
  color: blue;
  cursor: pointer;
  user-select: none;
}

.small-btn {
  padding: 0.3rem 0.6rem;
  font-size: 0.85rem;
  border: none;
  border-radius: 4px;
  cursor: pointer;
}

#clear_button {
  background-color: rgb(240, 240, 240);
  color: gray;
}

#clear_button:hover {
  filter: brightness(1.2);
}

#initialize_button {
  background-color: #f44336;
  color: white;
}

#initialize_button:hover {
  filter: brightness(1.2);
}

#reload_button {
  background-color: blue;
  color: white;
}

#reload_button:hover {
  filter: brightness(1.2);
}

.large-btn {
  /* add_record */
  width: 25%;
  max-width: 120px;
  height: 55px;
  font-size: 18pt;
  background-color: #4CAF50;
  border-radius: 10pt;
  border: none;
  padding: 5px;
  color: white;
  cursor: pointer;
}

.large-btn:disabled {
  color: gray;
  background: rgb(240, 240, 240);
  cursor: not-allowed;
}

.large-btn:hover {
  filter: brightness(1.2);
}

.setting_table {
  padding: 3px 10px;
  text-align: center;
  width: 100%;
}

.setting_table th {
  background-color: rgb(240, 240, 240);
  font-size: 0.7rem;
  padding: 0.3rem;
  width: 100%;
  white-space: nowrap;
}

.setting_table td {
  font-size: 0.7rem;
  white-space: nowrap;
}

.place_field {
  text-align: left;
  width: 100%;
  max-width: 250px;
}

button {
  appearance: none;
  -webkit-appearance: none;
  color: #00f;
  border-radius: 20px;
  background-color: transparent;
  text-align: center;
  padding: 10px 20px 10px;
  border: none;
  cursor: pointer;
}

.disabled_button {
  font-size: 16pt;
  padding: 3px;
  color: rgb(240, 240, 240);
  /*cursor: not-allowed;*/
}

.enabled_button {
  font-size: 16pt;
  padding: 3px;
  color: blue;
}

.enabled_button {
  filter: brightness(1.2);
}

.reload_button {
  background: #00bcd4;
  color: #fff;
  border: none;
  padding: 6px 12px;
  border-radius: 4px;
  cursor: pointer;
}

.box_shadow {
  padding: 15px;
  margin: 20px;
  border: 1px solid #c7c7c7;
  border-radius: 10px;
  box-shadow: 2px 2px 4px rgb(199, 199, 199);
}

.suggestion_box {
  padding: 7px;
  border: none;
  border-radius: 10px;
  background-color: #ffffcc;
  word-wrap: break-word;
  /*box-shadow: 2px 2px 4px rgb(199, 199, 199);*/
}

#electric_mileage {
  cursor: pointer;
}

#reload {
  margin-top: 10px;
  font-size: 12pt;
}

.footer {
  margin-top: 50pt;
  text-align: center;
  width: 100%;
  font-size: 0.8rem;
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  text-decoration: none;
  margin-bottom: 30px;
}

.url {
  font-size: 0.8rem;
  font-family: 'Times New Roman', Times, serif;
  font-style: italic;
  text-decoration: none;
}

main {
  position: relative;
  overflow: hidden;
}

#app-container {
  position: relative;
  transition: height 0.3s ease;
  /* 高さ変更も滑らかに */
  overflow: hidden;
}

.page-content {
  position: absolute;
  width: 100%;
  top: 0;
  left: 0;
  opacity: 0;
  visibility: hidden;
  transform: translateX(100%);
  transition:
    transform 0.4s ease-in-out,
    opacity 0.4s ease-in-out;
  will-change: transform, opacity;
}

.page-content.active {
  transform: translateX(0);
  visibility: visible;
  /* 表示と同時に見せる */
  opacity: 1;
}

/* 進む（右→左） */
.slide-forward-in {
  transform: translateX(100%);
}

/* 戻る（左→右） */
.slide-backward-in {
  transform: translateX(-100%);
}

/* 旧ページのフェードアウト用 */
.page-content.fade-out {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.page-content.exit {
  transform: translateX(-100%);
  opacity: 0;
}

.page-inner {
  position: static;
  background: transparent;
  width: 100%;
  text-align: center;
  margin: 0 auto;
}

.card {
  position: relative;
  background-color: white;
  padding: 1.5rem;
  border: 1px solid #c7c7c7;
  border-radius: 10px;
  box-shadow: 2px 2px 4px rgb(199, 199, 199);
  margin: 1rem;
  font-size: 0.9rem;
}

.card label {
  font-size: 0.85rem;
  display: inline-block;
  width: 9em;
  margin-right: 0.5em;
}

.card .value {
  display: inline-block;
  margin-bottom: 0.2rem;
}

.card .memo {
  color: gray;
  font-weight: normal;
}

.card-row {
  margin-bottom: 0.2rem;
  text-align: left;
}

.card-index {
  position: absolute;
  bottom: 0.5rem;
  left: 1rem;
  font-size: 0.75rem;
  color: #888;
}

.card-index a {
  text-decoration: none;
  color: inherit;
}

.card-index a:hover {
  text-decoration: none;
  filter: brightness(1.2);
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  min-height: 100vh;
  width: 100vw;
  transition: opacity 0.3s ease;
  overflow: hidden;
}

.modal.show {
  display: flex;
}

@supports (-webkit-touch-callout: none) {
  .modal {
    height: 100dvh;
    /* iOS Safariの正確な高さ指定 */
  }
}

.modal-content {
  background: #fff;
  padding: 1rem;
  border-radius: 10px;
  width: min(90%, 450px);
  /* 幅を少し広げて調整 */
  max-height: 80vh;
  overflow-y: auto;
  box-sizing: border-box;
}

.modal-content h3 {
  margin: 0 0 1rem;
  font-size: 1.25rem;
}

form {
  width: 100%;
}

.modal-form-row {
  display: flex;
  flex-wrap: wrap;
  /* ← iPhoneで必須！ */
  align-items: center;
  margin: 0.25rem 0;
  width: 100%;
  box-sizing: border-box;
}

.modal-form-row label {
  width: 130px;
  font-size: 0.85rem;
  flex-shrink: 0;
  margin-right: 0.5rem;
  white-space: nowrap;
  /* 改行させない */
}

.modal-form-row input {
  flex: 1;
  min-width: 0;
  width: auto !important;
  max-width: none !important;
  padding: 0.5rem;
  font-size: 1rem;
  border: 1px solid #ccc;
  border-radius: 5px;
  box-sizing: border-box;
}

.card-buttons {
  display: flex;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 1rem;
}

.edit-btn,
.delete-btn {
  padding: 0.5rem 1rem;
  border: none;
  border-radius: 5px;
  cursor: pointer;
  font-size: 1rem;
}

.edit-btn {
  background-color: #4CAF50;
  color: white;
}

.delete-btn {
  background-color: #f44336;
  color: white;
}

.toast {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  background-color: rgba(50, 50, 50, 0.95);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 6px;
  box-shadow: 0 4px 10px rgba(0, 0, 0, 0.2);
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 90%;
  width: max-content;
  white-space: normal;
  word-break: break-word;
  z-index: 9999;
  display: none;
  animation: fadein 0.3s ease, fadeout 0.3s ease 2s;
}

/* アニメーション */
@keyframes fadein {
  from {
    opacity: 0;
    transform: translateX(-50%) translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
  }
}

@keyframes fadeout {
  from {
    opacity: 1;
  }

  to {
    opacity: 0;
  }
}

.top-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin: 15px;
}

.top-buttons button {
  flex: 1;
  padding: 0.4rem;
  font-size: 1rem;
  border: none;
  border-radius: 4px;
  background-color: #4CAF50;
  color: white;
  min-width: 40px;
  white-space: nowrap;
}



/* ===================
   補足：小型スマホ専用
   （iPhone SE / iPhone 8以下）
   =================== */

@media screen and (max-width: 375px) {

  .shadow_frame {
    padding: 1rem 1rem;
  }

  #input_table {
    table-layout: fixed;
  }

  #input_table td {
    padding: 0px;
    word-break: break-word;
  }

  input[type="date"],
  input[list],
  select,
  input[type="number"] {
    width: 100%;
    font-size: 0.9rem;
    box-sizing: border-box;
  }

  .input-unit {
    display: flex;
    align-items: center;
    gap: 4px;
  }

  .input-unit input {
    flex: 1;
    min-width: 0;
  }

  .note,
  .warn,
  .desc {
    width: 100%;
    font-size: 0.7rem;
    margin-left: 5px;
    margin-right: 5px;
  }

  .suggestion_box {
    padding: 3px;
  }


  .small-btn,
  #clear_button {
    font-size: 0.85rem;
    padding: 4px 8px;
  }

  #result_table {
    width: 100%;
  }

  .setting_table {
    width: 100%;
    table-layout: fixed;
  }

  .setting_table td {
    padding: 2px;
    vertical-align: middle;
    white-space: nowrap;
  }

  .setting_table th {
    white-space: nowrap;
  }

  .place_field {
    width: 100%;
    max-width: 140px;
    box-sizing: border-box;
    font-size: 0.9rem;
  }

  .setting_table input[type="number"] {
    width: 100%;
    max-width: 100px;
    box-sizing: border-box;
    font-size: 0.9rem;
  }

  form[name="form3"] .setting_table tr {
    display: flex;
  }

    form[name="form3"] .setting_table td:first-child {
    flex: 2; /* 場所名を広く */
    padding-right: 4px;
  }

    form[name="form3"] .setting_table td:last-child {
    flex: 1; /* 単価を狭く */
  }

  form[name="form4"] .setting_table {
    width: 100%;
    table-layout: fixed;
  }

  form[name="form4"] .setting_table td {
    width: 33.3%;
    padding: 4px;
    text-align: center;
    vertical-align: middle;
  }

  form[name="form4"] .setting_table select,
  form[name="form4"] .setting_table input[type="number"] {
    width: 100%;
    box-sizing: border-box;
    font-size: 0.9rem;
  }

  .top-buttons button {
    font-size: 0.8rem;
  }
}

@media (min-width: 768px) {

  input[type="number"],
  input[type="date"],
  input[list] {
    max-width: 150px;
    /* PCでは少し広げる */
  }

  input[type="text"] {
    max-width: 300px;
  }

  .item_title {
    font-size: 0.8rem;
  }

  input::placeholder {
    font-size: 0.9rem;
  }
}