body {
    font-family: Arial, Helvetica, sans-serif;
    background: #7ec2e4;
    color: #fff;
    font-size: 16px;
  }

  h2 {
    font-size: 18px;
  }

  section.main {
    display: flex;
  }
  #sidebar{
    position: fixed; 
    bottom: 0; 
    width: 100%;
  }
  #menu,
  section.main {
    flex-direction: column;
  }

  #menu {
    display: flex;
    justify-content: space-between;
    flex-wrap: nowrap;
    background: #59b0dc;
    padding: 4px;
    padding-bottom: 10px;
    border-radius: 4px;
    font-size: 14px;
    width: 100vw;
    height: 57vw;
  }

  #content {
    display: flex;
    flex-wrap: wrap;
    align-items: stretch;
    justify-content: center;
  }

  figure {
    padding: 0px;
    margin: 0;
    -webkit-margin-before: 0;
    margin-block-start: 0;
    -webkit-margin-after: 0;
    margin-block-end: 0;
    -webkit-margin-start: 0;
    margin-inline-start: 0;
    -webkit-margin-end: 0;
    margin-inline-end: 0;
  }

  figure img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 4px;
    margin-top: 8px;
  }

  @media (min-width: 800px) and (orientation: landscape) {
    #content {
      display: flex;
      flex-wrap: nowrap;
      align-items: stretch;
    }
    figure img {
      display: block;
      max-width: 100%;
      max-height: calc(100vh - 40px);
      width: auto;
      height: auto;
    }
    figure {
      padding: 0 0 0 0px;
      margin: 0;
      -webkit-margin-before: 0;
      margin-block-start: 0;
      -webkit-margin-after: 0;
      margin-block-end: 0;
      -webkit-margin-start: 0;
      margin-inline-start: 0;
      -webkit-margin-end: 0;
      margin-inline-end: 0;
    }
  }

  section#buttons {
    display: flex;
    flex-wrap: nowrap;
    justify-content: space-between;
  }

  #nav-toggle {
    cursor: pointer;
    display: block;
    font-size: 28px;
    font-weight: bold;
  }

  #nav-toggle-cb {
    outline: 0;
    opacity: 0;
    width: 0;
    height: 0;
  }


  .input-group {
    display: flex;
    flex-wrap: nowrap;
    line-height: 22px;
    margin: 5px 0;
  }

  .input-group > label {
    display: inline-block;
    padding-right: 10px;
    min-width: 47%;
  }

  .input-group input,
  .input-group select {
    flex-grow: 1;
  }

  .range-max,
  .range-min {
    display: inline-block;
    padding: 0 5px;
  }

  button,
  .button {
    display: block;
    margin: 5px;
    padding: 20px;
    border: 0;
    line-height: 28px;
    cursor: pointer;
    color: #000;
    background: #ffef8c;
    border-radius: 5px;
    font-size: 24px;
    outline: 0;
  }

  #ocr-button{
    width: 30px;
    height: 30px;
    padding: 0px;
    font-size: 10px;
    margin: 0;
  }

  .save {
    position: absolute;
    right: 25px;
    top: 0px;
    height: 16px;
    line-height: 16px;
    padding: 0 4px;
    text-decoration: none;
    cursor: pointer;
    z-index: 1000;
    font-size: 16px;
  }

  button:hover {
    background: #fce96b;
  }

  button:active {
    background: #fce96b;
  }

  button.disabled {
    cursor: default;
    background: #a0a0a0;
  }

  input[type="range"] {
    -webkit-appearance: none;
    width: 100%;
    height: 22px;
    background: #59b0dc;
    cursor: pointer;
    margin: 0;
  }

  input[type="range"]:focus {
    outline: 0;
  }

  input[type="range"]::-webkit-slider-runnable-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: #efefef;
    border-radius: 0;
    border: 0 solid #efefef;
  }

  input[type="range"]::-webkit-slider-thumb {
    border: 1px solid rgba(0, 0, 30, 0);
    height: 22px;
    width: 22px;
    border-radius: 50px;
    background: #ffef8c;
    cursor: pointer;
    -webkit-appearance: none;
    margin-top: -11.5px;
  }

  input[type="range"]:focus::-webkit-slider-runnable-track {
    background: #efefef;
  }

  input[type="range"]::-moz-range-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: #efefef;
    border-radius: 0;
    border: 0 solid #efefef;
  }

  input[type="range"]::-moz-range-thumb {
    border: 1px solid rgba(0, 0, 30, 0);
    height: 22px;
    width: 22px;
    border-radius: 50px;
    background: #ffef8c;
    cursor: pointer;
  }

  input[type="range"]::-ms-track {
    width: 100%;
    height: 2px;
    cursor: pointer;
    background: 0 0;
    border-color: transparent;
    color: transparent;
  }

  input[type="range"]::-ms-fill-lower {
    background: #efefef;
    border: 0 solid #efefef;
    border-radius: 0;
  }

  input[type="range"]::-ms-fill-upper {
    background: #efefef;
    border: 0 solid #efefef;
    border-radius: 0;
  }

  input[type="range"]::-ms-thumb {
    border: 1px solid rgba(0, 0, 30, 0);
    height: 22px;
    width: 22px;
    border-radius: 50px;
    background: #ffef8c;
    cursor: pointer;
    height: 2px;
  }

  input[type="range"]:focus::-ms-fill-lower {
    background: #efefef;
  }

  input[type="range"]:focus::-ms-fill-upper {
    background: #59b0dc;
  }

  .switch {
    display: block;
    position: relative;
    line-height: 22px;
    font-size: 16px;
    height: 22px;
  }

  .switch input {
    outline: 0;
    opacity: 0;
    width: 0;
    height: 0;
  }

  .slider {
    width: 50px;
    height: 22px;
    border-radius: 22px;
    cursor: pointer;
    background-color: grey;
  }

  .slider,
  .slider:before {
    display: inline-block;
    transition: 0.4s;
  }

  .slider:before {
    position: relative;
    content: "";
    border-radius: 50%;
    height: 16px;
    width: 16px;
    left: 4px;
    top: 3px;
    background-color: #fff;
  }

  input:checked + .slider {
    background-color: #ffef8c;
  }

  input:checked + .slider:before {
    -webkit-transform: translateX(26px);
    transform: translateX(26px);
  }

  select {
    border: 1px solid #59b0dc;
    font-size: 14px;
    height: 22px;
    outline: 0;
    border-radius: 5px;
  }

  .image-container {
    position: relative;
    min-width: 160px;
    width: 96vw;
  }

  #stream {
    width: 100%;
    height: 100%;
    object-fit: cover;
  }

  #stream-container {
    width: 100vw;  /* ビューポートの幅 */
    height: 100vw;  /* 正方形にするため、幅と同じ値を設定 */
    position: relative;
    overflow: hidden;
  }

  #send-img canvas {
    width: 100%;
    height: 100%;
    /* object-fit: cover; */
  }

  #ocr-result {
    width: 100%;
    height: 110px;
    overflow-y: scroll;
  }

  .close {
    position: absolute;
    right: 5px;
    top: 5px;
    background: #ffef8c;
    width: 16px;
    height: 16px;
    border-radius: 100px;
    color: #fff;
    text-align: center;
    line-height: 18px;
    cursor: pointer;
    z-index: 1000;
  }

  .hidden {
    display: none;
  }

  input[type="text"] {
    border: 1px solid #59b0dc;
    font-size: 14px;
    height: 20px;
    margin: 1px;
    outline: 0;
    border-radius: 5px;
  }

  .inline-button {
    line-height: 20px;
    margin: 2px;
    padding: 1px 4px 2px 4px;
  }

  label.toggle-section-label {
    cursor: pointer;
    display: block;
  }

  input.toggle-section-button {
    outline: 0;
    opacity: 0;
    width: 0;
    height: 0;
  }

  input.toggle-section-button:checked + section.toggle-section {
    display: none;
  }

  .flex-btn {
    display: flex;
    justify-content: center;
    margin: 0;
    height: 30px;
  }

  #send-img {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vw;
    background: rgba(255, 255, 255, 0.9);
    z-index: 1000;
    justify-content: center;
    align-items: center;
  }

  #send-img.active {
    display: flex;
  }

  /* モーダルデザイン */
  #customConfirm {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    z-index: 1000;
    display: flex;
    justify-content: center;
    align-items: center;
  }
  
  .modal {
    background: white;
    padding: 20px 30px;
    border-radius: 10px;
    text-align: center;
    font-size: 18px; /* ← 文字サイズ調整 */
    margin: 0 12px;
  }
  
  .modal-buttons {
    margin-top: 20px;
    display: flex;
    justify-content: space-between;
  }
  
  .modal-buttons button {
    margin: 0 10px;
    padding: 10px 20px;
    font-size: 16px;
  }

  .message{
    color: #000;
  }
  