:root {
  --main-color: #46b4be;
}

body {
  font-family: "LINE Seed JP", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 14px;
  line-height: 1.5;
  margin: 0;
  background: #f5f5f5;
  box-sizing: border-box;
}

header {
  background: white;
  border-bottom: solid 1px #ddd;
}

#header_inner {
  position: relative;
  display: flex;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 8px 16px;
  color: var(--main-color);
  align-items: center;
}

h1 {
  font-size: 24px;
  margin: 0;
}

#logo {
  display: flex;
}

#logo img {
  width: 64px;
  height: auto;
}

.container {
  max-width: 1200px;
  padding: 16px;
  margin: 0 auto;
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
}

.section {
  flex: 1;
  min-width: 280px;
  background: white;
  padding: 20px;
  border-radius: 12px;
  border: solid 1px #ddd;
}

.form-inner {
  margin-bottom: 40px;
}

.preview-section {
  overflow: hidden;
  position: relative;
  display: flex;
  flex-direction: column;
  aspect-ratio: 1 / 1.414;
  align-items: center;
  height: fit-content;
}

#pdf-renderer {
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

h2 {
  font-size: 20px;
  border-bottom: solid 2px var(--main-color);
  color: var(--main-color);
  margin: 0;
  padding-bottom: 4px;
}

label {
  display: block;
  margin-top: 16px;
  font-weight: 600;
}

.required {
  margin-left: 2px;
  color: red;
}

input,
select,
textarea {
  display: block;
  width: 100%;
  padding: 12px;
  font-family: "LINE Seed JP", sans-serif;
  font-weight: 400;
  font-style: normal;
  font-size: 1rem;
  line-height: 1.5;
  border-radius: 12px;
  border: 1px solid #ddd;
  background: #fff;
  color: #000;
  box-sizing: border-box;
  appearance: none;
  -webkit-appearance: none !important;
}

input,
select {
  height: calc(1.5em + 24px);
  margin-top: 4px;
}

select,
::picker(select) {
  appearance: base-select;
  -webkit-appearance: base-select !important;
}

::picker(select) {
  border-radius: 12px;
  border: 1px solid #ddd;
}

option {
  padding: 8px;
}

.select_wrapper {
  position: relative;
}

.select_wrapper::after {
  content: "";
  position: absolute;
  top: 17px;
  right: 18px;
  width: 8px;
  height: 8px;
  border-right: 2px solid;
  border-bottom: 2px solid;
  transform: rotate(45deg);
}

.item-select hr {
  border: none;
  border-top: 1px solid #ddd;
  margin: 0 16px;
  height: 0;
}

textarea {
  resize: none;
  font-size: 14px;
}

.table-bordered {
  margin-top: 16px;
  border-collapse: collapse;
  width: 100%;
  table-layout: fixed;
}

.table-bordered td {
  padding: 4px;
}

#order-table {
  width: 100%;
  border-collapse: collapse;
}

#order-table th:nth-child(1),
#order-table td:nth-child(1) {
  width: 50%;
  padding-left: 0;
}

#order-table th:nth-child(2),
#order-table td:nth-child(2) {
  width: 15%;
}

#order-table th:nth-child(3),
#order-table td:nth-child(3) {
  width: 15%;
  padding-right: 0;
}

.amount {
  border: none;
  pointer-events: none;
}

button {
  display: block;
  width: 200px;
  margin: 20px auto;
  padding: 12px;
  border: none;
  border-radius: 12px;
  background: var(--main-color);
  color: white;
  font-size: 14px;
  cursor: pointer;
}

button:disabled {
  background: #aaa;
  cursor: not-allowed;
}

input[type=checkbox] {
  display: none;
}

.checkbox01 {
  position: relative;
  display: flex;
  align-items: center;
  width: auto;
  height: 48px;
  margin: 0;
  padding: 0 40px;
  border-radius: 12px;
  border: 1px solid #ddd;
  cursor: pointer;
}

.checkbox01::before {
  display: block;
  content: '';
  width: 16px;
  height: 16px;
  position: absolute;
  top: calc(50% - 8px);
  left: 16px;
  border-radius: 4px;
  border: 1px solid #ddd;
}

.checkbox01::after {
  display: block;
  content: '';
  border-right: 2px solid var(--main-color);
  border-bottom: 2px solid var(--main-color);
  width: 6px;
  height: 10px;
  position: absolute;
  top: 17px;
  left: 21px;
  opacity: 0;
  transform: rotate(45deg);
}

input[type=checkbox]:checked+.checkbox01::after {
  opacity: 1 !important;
}

.withholding-line {
  color: red;
}

.error-message {
  display: none;
  text-align: center;
  color: red;
}

#help-btn {
  position: absolute;
  right: 96px;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  margin: 0;
  border-radius: 50%;
  border: solid 2px var(--main-color);
  background: white;
  color: var(--main-color);
  font-size: 20px;
}

#help-modal {
  z-index: 1000;
  position: fixed;
  inset: 0;
  padding: 24px;
  background: #fff;
  display: none;
  justify-content: center;
  align-items: center;
  font-size: 16px;
}

#modal-inner {
  background: #fff;
  border-radius: 12px;
  max-width: 500px;
  width: 90%;
  padding: 24px;
  position: relative;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
}

#close-modal {
  position: absolute;
  top: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 64px;
  height: 64px;
  margin: 0;
  border: none;
  background: none;
  font-size: 40px;
  color: var(--main-color);
  cursor: pointer;
}

#help-modal ul {
  line-height: 1.75;
  padding-left: 20px;
}

@media (max-width: 768px) {
  .section {
    width: 100%;
  }

  #order-table thead {
    display: none;
  }

  #order-table tbody tr {
    display: flex;
    flex-wrap: wrap;
    margin-bottom: 12px;
  }

  #order-table td:nth-child(1) {
    width: calc(80% - 8px);
  }

  #order-table td:nth-child(2) {
    width: 20%;
    padding-right: 0;
    display: flex;
    align-items: center;
  }

  #order-table td:nth-child(2)::before {
    content: '×';
    width: 1em;
    margin-right: 8px;
  }

  #order-table td:nth-child(3),
  #order-table td:nth-child(4) {
    width: calc(50% - 8px);
    display: flex;
    align-items: center;
  }

  #order-table td:nth-child(3)::before {
    content: '単価:';
    width: 3rem;
  }

  #help-modal {
    font-size: 14px;
  }
}