/* ============================================================
   contents.directory – Mobile Overrides (Final)
   HTML構造修正後・最適化版
   ============================================================ */

@media (max-width: 767px) {

  /* ----------------------------------------------------------
     1) Global
  ---------------------------------------------------------- */
  html,
  body {
    width: 100%;
    margin: 0;
  }

  body {
    font-size: 14px;
    line-height: 1.6;
    overflow-x: hidden; /* ページ全体のはみ出し防止 */
  }

  img,
  video {
    max-width: 100%;
    height: auto;
  }

  /* ----------------------------------------------------------
     2) Main Wrappers
     ※ footer は main 外にある前提
  ---------------------------------------------------------- */
  main,
  .upload-wrapper,
  .result-wrapper,
  .login-main {
    width: 100%;
    max-width: none;
    padding-left: 1rem;
    padding-right: 1rem;
    box-sizing: border-box;
  }

  .upload-wrapper,
  .result-wrapper {
    margin-top: 2rem;
    margin-bottom: 3rem;
  }

  /* ----------------------------------------------------------
     3) Login Page
  ---------------------------------------------------------- */
  .login-main {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
  }

  .login-container {
    width: 100%;
  }

  /* ----------------------------------------------------------
     4) Headings / Text
  ---------------------------------------------------------- */
  h1 {
    font-size: 1.4rem;
    line-height: 1.4;
  }

  h2 {
    font-size: 1.2rem;
  }

  p,
  li,
  th,
  td {
    font-size: 0.9rem;
  }

  /* ----------------------------------------------------------
     5) Forms (login / upload)
  ---------------------------------------------------------- */
  input,
  select,
  textarea,
  button {
    font-size: 16px; /* iOS zoom防止 */
  }

  form {
    gap: 0.75rem;
  }

  /* ----------------------------------------------------------
     6) Result Table
     → table-scroll が存在する前提
  ---------------------------------------------------------- */
  .table-scroll {
    width: 100%;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
  }

  .result-table {
    min-width: 720px;
    border-collapse: collapse;
  }

  .result-table th,
  .result-table td {
    white-space: nowrap;
  }

  /* ----------------------------------------------------------
     7) Copy UI
  ---------------------------------------------------------- */
  .copy-cell {
    display: flex;
    gap: 0.5rem;
    align-items: center;
  }

  .copy-btn {
    flex-shrink: 0;
  }

  /* ----------------------------------------------------------
     8) Footer
     → 構造で解決済みなので最低限
  ---------------------------------------------------------- */
  footer {
    text-align: center;
    padding: 1rem 0;
  }

  footer > * {
    display: block;
    margin: 0.25rem 0;
  }

}