body {
    font-family: Arial, sans-serif;
    background-color: #f8f8f8;
    margin: 0;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: flex-start;
    min-height: 100vh;
    overflow-y: auto;
  }
  
  .container {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 0 10px rgba(0,0,0,0.1);
    width: 100%;
    max-width: 800px;
  }
  
  h2 {
    text-align: center;
  }
  
  .input-group {
    margin-bottom: 15px;
  }
  
  .input-group label {
    display: block;
    margin-bottom: 5px;
    font-size: 0.9rem;
  }
  
  .input-group input {
    width: 97%;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 5px;
    font-size: 1rem;
  }
  
  .button {
    width: 100%;
    padding: 12px;
    background-color: #28a745; /* Bootstrap風に統一 */
    color: white;
    border: none;
    border-radius: 5px;
    font-size: 1rem;
    cursor: pointer;
    margin-bottom: 10px;
  }
  
  .button:hover {
    background-color: #218838;
  }
  
  /* ログアウトボタン専用スタイル */
  .logout-button {
    background-color: #6c757d !important;
    color: #fff !important;
  }
  .logout-button:hover {
    background-color: #5a6268 !important;
  }
  
  .link {
    display: block;
    text-align: center;
    margin-top: 10px;
    color: #007BFF;
    cursor: pointer;
  }
  .link:hover {
    text-decoration: underline;
  }
  
  #entryPage {
    background-color: #ffffff;
    border-radius: 10px;
    padding: 25px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    margin: 30px auto;
  }
  #entryPage h2 {
    font-size: 1.6rem;
    text-align: center;
    margin-bottom: 25px;
    color: #333;
  }
  
  .filter2-area {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
  }
  .filter2-area label {
    font-size: 1rem;
    color: #555;
  }
  #filter2-select {
    padding: 10px;
    font-size: 1rem;
    border-radius: 5px;
    border: 1px solid #ccc;
    min-width: 180px;
  }
  .filter2-area button {
    padding: 10px 18px;
    font-size: 1rem;
    border: none;
    color: white;
    border-radius: 5px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  
  /* 決定ボタン（進む＝緑） */
  #applyFilterBtn {
    background-color: #28a745;
    color: #fff;
  }
  #applyFilterBtn:hover {
    background-color: #218838;
  }
  
  /* 戻るボタン（グレー） */
  #backFromEntryBtn {
    background-color: #6c757d;
    color: #fff;
  }
  #backFromEntryBtn:hover {
    background-color: #5a6268;
  }
  
  .entry_main {
    padding: 10px;
    border-top: 1px solid #ddd;
    margin-top: 10px;
    display: flex;
    flex-direction: column;
    gap: 16px;
  }
  
  .form-group p {
    border: none !important;
    background: none !important;
    padding: 0 !important;
    margin: 0 0 0.5em 0 !important;
    font-size: 1rem;
    color: #333;
  }
  
  .form-group {
    display: flex;
    flex-direction: column;
    gap: 4px;
  }
  
  .form-label {
    font-weight: bold;
    font-size: 1rem;
    color: #333;
    margin-bottom: 4px;
  }
  
  .form-element {
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
  }
  
  .form-label .required-asterisk {
    color: red;
    margin-left: 4px;
    font-weight: bold;
  }
  
  textarea.form-element {
    resize: vertical;
    min-height: 100px;
  }
  
  select.form-element {
    background-color: #fff;
  }
  
  img.form-element {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
  }
  
  .entry_main a {
    color: #007BFF;
    text-decoration: none;
  }
  .entry_main a:hover {
    text-decoration: underline;
  }
  
  .total-amount-area {
    margin-top: 30px;
    padding: 15px;
    font-size: 1.2rem;
    font-weight: bold;
    background-color: #f4f8ff;
    border: 1px solid #cddff5;
    border-radius: 6px;
    text-align: center;
    color: #333;
  }
  .total-amount-area span {
    color: #007BFF;
    font-size: 1.4rem;
  }
  
  .form-footer {
    display: flex;
    justify-content: space-between;
    margin-top: 2rem;
  }
  
  .btn {
    padding: 0.5rem 1.5rem;
    font-size: 1rem;
    cursor: pointer;
  }
  
  /* 進むボタン */
  .confirm-button,
  .submit-button,
  .confirm-buttons button:first-child,
  .order-buttons button:first-child {
    background-color: #28a745 !important;
    color: #fff !important;
  }
  .confirm-button:hover,
  .submit-button:hover,
  .confirm-buttons button:first-child:hover,
  .order-buttons button:first-child:hover {
    background-color: #218838 !important;
  }
  
  /* 戻るボタン */
  .back-button,
  .confirm-buttons button:last-child,
  .order-buttons button:last-child,
  #orderHistoryBackBtn {
    background-color: #6c757d !important;
    color: #fff !important;
  }
  .back-button:hover,
  .confirm-buttons button:last-child:hover,
  .order-buttons button:last-child:hover,
  #orderHistoryBackBtn:hover {
    background-color: #5a6268 !important;
  }
  
  .input-error {
    border: 2px solid red;
    background-color: #fff0f0;
    color: #b00000;
  }
   
  .confirm-item {
    margin-bottom: 1em;
    padding: 0.5em;
    border-bottom: 1px solid #ddd;
  }
  .confirm-item strong {
    display: block;
    font-weight: bold;
    margin-bottom: 0.3em;
  }
  
  .confirm-buttons {
    margin-top: 2em;
    text-align: center;
  }
  .confirm-buttons button {
    margin: 0 1em;
    padding: 0.6em 1.2em;
    font-size: 1em;
    cursor: pointer;
  }
  
  .total-confirm {
    font-weight: bold;
    font-size: 1.1em;
    color: #2c3e50;
    background-color: #f0f9ff;
    border: 1px solid #cce5ff;
    border-radius: 4px;
    padding: 1em;
  }
  
  /* 申し込み済一覧 */
  .course-list-table {
    width: 100%;
    border-collapse: collapse;
    margin-top: 20px;
    font-size: 0.95rem;
    background-color: #fff;
    border: 1px solid #ddd;
    border-radius: 6px;
    overflow: hidden;
  }
  .course-list-table thead th {
    background-color: #f0f4f8;
    padding: 12px;
    border-bottom: 1px solid #ccc;
    color: #333;
    text-align: left;
    font-weight: bold;
  }
  .course-list-table td {
    padding: 10px 12px;
    border-bottom: 1px solid #eee;
    color: #333;
  }
  .course-list-table tr:last-child td {
    border-bottom: none;
  }
  
  .cancel-button {
    background-color: #ff5c5c;
    color: white;
    border: none;
    border-radius: 5px;
    padding: 6px 12px;
    font-size: 0.9rem;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  .cancel-button:hover {
    background-color: #e04848;
  }
  .cancel-status-text {
    color: #999;
    font-style: italic;
    font-size: 0.9rem;
  }
  
  /* 商品注文 */
  #orderPage, #confirmationPage {
    background-color: #fff;
    border-radius: 8px;
    padding: 20px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
    width: 100%;
    max-width: 800px;
    margin: 30px auto;
    box-sizing: border-box;
  }
  #orderPage h2, #confirmationPage h2 {
    font-size: 1.4rem;
    text-align: center;
    margin-bottom: 1em;
    color: #333;
  }
  
  .form-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 10px;
    margin-bottom: 1rem;
  }
  .form-row label {
    min-width: 80px;
    font-weight: bold;
    font-size: 1rem;
    color: #333;
  }
  .form-row .product-select {
    flex: 8;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fff;
    box-sizing: border-box;
  }
  .form-row .quantity-select {
    flex: 2;
    padding: 10px;
    border: 1px solid #ccc;
    border-radius: 6px;
    font-size: 1rem;
    background-color: #fff;
    box-sizing: border-box;
  }
  
  /* 合計・送料表示 */
  #shippingFee, #totalAmount, #confirmShipping, #confirmTotal {
    font-size: 1.1rem;
    font-weight: bold;
    color: #2c3e50;
    background-color: #f4f8ff;
    border: 1px solid #cddff5;
    border-radius: 6px;
    padding: 10px;
    text-align: center;
    margin-top: 20px;
  }
  
  /* ボタン配置 */
  .order-buttons,
  .confirm-buttons {
    display: flex;
    justify-content: center;
    gap: 20px;
    margin-top: 2rem;
  }
  .order-buttons button,
  .confirm-buttons button {
    padding: 0.7rem 1.5rem;
    font-size: 1rem;
    border-radius: 6px;
    border: none;
    cursor: pointer;
  }
  
  /* 商品注文履歴 */
  .orderHistory-area {
    margin-bottom: 1.5em;
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
  }
  .orderHistory-area label {
    font-size: 1rem;
    color: #333;
  }
  #orderHistory-select {
    padding: 10px;
    font-size: 1rem;
    border: 1px solid #ccc;
    border-radius: 6px;
    min-width: 240px;
  }
  #orderHistoryFilterBtn {
    background-color: #28a745;
    color: #fff;
  }
  #orderHistoryFilterBtn:hover {
    background-color: #218838;
  }
  
  .order-row {
    border: 1px solid #ccc;
    border-radius: 8px;
    padding: 1em;
    margin-bottom: 1em;
    background-color: #fff;
    box-shadow: 0 1px 4px rgba(0,0,0,0.05);
  }
  .order-row p {
    margin: 0.2em 0;
    font-size: 0.95rem;
    color: #333;
  }
  .order-row .cancel-btn {
    background-color: #ff5c5c;
    color: white;
    border: none;
    padding: 8px 12px;
    font-size: 0.9rem;
    border-radius: 5px;
    cursor: pointer;
    margin-top: 0.5em;
    transition: background-color 0.3s ease;
  }
  .order-row .cancel-btn:hover {
    background-color: #e04848;
  }
  
  .cancel-confirm {
    padding: 1.5em;
    border: 2px solid #f5c6cb;
    background-color: #fff5f5;
    border-radius: 8px;
    margin-top: 1em;
  }
  .cancel-confirm h3 {
    color: #c82333;
    margin-bottom: 1em;
  }
  .cancel-confirm p {
    margin: 0.5em 0;
    font-size: 0.95rem;
  }
  
  .input-inline-wrapper {
    display: flex;
    align-items: center;
    gap: 10px;
  }
  .input-inline-wrapper input {
    flex: 1;
  }
  .address-fetch-button {
    padding: 6px 12px;
    background-color: #007BFF;
    color: white;
    border: none;
    font-size: 0.95rem;
    border-radius: 4px;
    cursor: pointer;
    transition: background-color 0.3s ease;
  }
  .address-fetch-button:hover {
    background-color: #0056b3;
  }
  
  /* 個人データ編集 */
  #studentEditForm .button .logout-button {
    background-color: #6c757d;
    color: #fff;
  }
  
  /* LINE 登録説明ページ */
  #studentLinePage { padding: clamp(12px, 2.5vw, 24px); }
  #studentLinePage.container.page { max-width: 960px; margin: 0 auto; }
  #studentLineForm { display: grid; gap: clamp(12px, 2vw, 20px); }
  .line-card {
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    padding: clamp(14px, 2.5vw, 24px);
    box-shadow: 0 1px 2px rgba(0,0,0,.04);
    background: #fff;
  }
  .line-title { font-size: clamp(18px, 2vw, 22px); font-weight: 700; margin: 0 0 6px; }
  #studentLinePage .line-desc span { color: #dc2626; font-weight: 700; }
  .line-desc { font-size: clamp(14px, 1.6vw, 16px); color: #374151; line-height: 1.7; margin: 0; }
  .line-id-row { display: flex; align-items: center; gap: 12px; margin-top: 10px; flex-wrap: wrap; }
  .line-id-desc { margin: 10px 0; font-size: .9rem; opacity: .8; }

  .line-id-badge {
    font-family: monospace;
    background: #f3f4f6;
    border: 1px dashed #d1d5db;
    padding: 6px 10px;
    border-radius: 8px;
    user-select: all;
    white-space: nowrap;
    flex: 1 1 260px;
  }
  
  /* LINE 登録ページ ボタン */
  .btn {
    appearance: none;
    border: 1px solid #e5e7eb;
    background: #fff;
    padding: 12px 16px;
    border-radius: 10px;
    cursor: pointer;
    font-size: 14px;
    min-height: 44px;
    transition: background-color .2s, filter .2s, opacity .2s, transform .06s;
  }
  .btn:hover { background: #f9fafb; }
  .btn:active { transform: translateY(1px); }
  .btn:disabled { opacity: .6; cursor: not-allowed; }
  .btn-primary {
    background: #28a745;
    color: #fff;
    border-color: #28a745;
  }
  .btn-primary:hover { filter: brightness(0.95); }
  
  .actions { display: flex; justify-content: flex-end; gap: 10px; }

  .line-link-row { margin-top: 12px; }
  .line-link-desc { margin: 6px 0; font-size: .9rem; opacity: .8; }
  .line-url-text { margin-top: 6px; font-size: .85rem; word-break: break-all; opacity: .7; }

  /* --- 戻る／決定ボタン専用スタイル --- */

  /* 戻るボタン：グレー */
  #backToFormBtn {
    background-color: #6c757d !important;
    color: #fff !important;
  }
  #backToFormBtn:hover {
    background-color: #5a6268 !important;
  }

  /* 決定ボタン：緑 */
  #submitToGASBtn {
    background-color: #28a745 !important;
    color: #fff !important;
  }
  #submitToGASBtn:hover {
    background-color: #218838 !important;
  }

  
  /* スマホ対応 */
  @media (max-width: 480px) {
    .container { padding: 15px; max-width: 400px; }
    .filter2-area { flex-direction: column; align-items: stretch; }
    #filter2-select, .filter2-area button { width: 100%; }
    .course-list-table { border: 0; }
    .course-list-table thead { display: none; }
    .course-list-table tr {
      display: block; margin-bottom: 20px;
      border: 1px solid #ccc; border-radius: 6px;
      background-color: #fff; padding: 10px;
    }
    .course-list-table td {
      display: flex; justify-content: space-between; align-items: center;
      padding: 8px 10px; border: none; border-bottom: 1px solid #eee;
      font-size: 0.95rem;
    }
    .course-list-table td::before {
      content: attr(data-label); font-weight: bold; color: #555; flex-basis: 40%;
    }
    .form-row { flex-direction: column; align-items: stretch; }
    .form-row .product-select, .form-row .quantity-select { width: 100%; }
    .order-buttons, .confirm-buttons { flex-direction: column; gap: 10px; }
    .order-buttons button, .confirm-buttons button { width: 100%; }
    .orderHistory-area { flex-direction: column; align-items: stretch; }
    #orderHistory-select, #orderHistoryFilterBtn, #orderHistoryBackBtn { width: 100%; }

    .line-card {
      margin: 8px 10px;
      padding: 16px;
      border-radius: 14px;
      box-shadow: 0 4px 12px rgba(0,0,0,.06);
    }
  
    .line-title { font-size: 1.1rem; margin-bottom: 10px; }
    .line-desc  { font-size: .95rem; margin-bottom: 14px; }
  
    .line-id-row {
      gap: 10px;
    }
  
    .line-id-badge {
      width: 100%;              /* IDは1行で見切れないように幅いっぱい */
      text-align: center;
      padding: 12px;
      font-size: 1rem;
    }
  
    .btn, .btn-primary, .btn-back {
      width: 100%;              /* ボタンは縦積みフル幅 */
      min-height: 48px;         /* タップしやすく */
      font-size: 1rem;
    }
  
    .actions {
      gap: 10px;
      margin-top: 12px;
      padding: 0 4px;
    }
  
    .line-link-row {
      gap: 10px;
    }
  
    .line-link-desc { font-size: .95rem; }
    .line-url-text  { font-size: .9rem; }
  
    /* 余白の最適化 */
    .line-card > *:not(:last-child) { margin-bottom: 12px; }
  
    /* .line-id-row { flex-direction: column; }
    .line-id-row .btn, .actions .btn { width: 100%; } */
  }
  
  #loading {
    display: none;
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background: rgba(255,255,255,0.7);
    justify-content: center; align-items: center;
    z-index: 999;
  }
  .spinner {
    border: 8px solid #f3f3f3;
    border-top: 8px solid #28a745;
    border-radius: 50%;
    width: 60px; height: 60px;
    animation: spin 1s linear infinite;
  }
  @keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
  }
  