    :root {
      --primary-color: #007bff;
      --success-color: #28a745;
      --aaa: #fe8900;
      --bbb: #945a8d;
      --danger-color: #dc3545;
      --bg-color: #f4f6f9;
      --card-bg: #ffffff;
      --border-color: #e2e8f0;
    }

    body {
      font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
      background-color: var(--bg-color);
      margin: 0;
      padding: 10px;
      color: #333;
    }

    .container {
      max-width: 600px;
      margin: 0 auto;
    }

    .card {
      background: var(--card-bg);
      border-radius: 12px;
      padding: 15px;
      margin-bottom: 15px;
      box-shadow: 0 2px 8px rgba(0,0,0,0.05);
      border: 1px solid var(--border-color);
    }

    h3 {
      margin-top: 0;
      font-size: 1.05rem;
      border-bottom: 2px solid var(--primary-color);
      padding-bottom: 6px;
      margin-bottom: 12px;
      color: #1e293b;
    }

    .grid-2 {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 10px;
    }

    label {
      font-size: 0.85rem;
      font-weight: bold;
      display: block;
      margin-bottom: 4px;
    }

    input[type="text"], input[type="password"], input[type="number"], textarea, select {
      width: 100%;
      padding: 8px 10px;
      border: 1px solid #cbd5e1;
      border-radius: 6px;
      box-sizing: border-box;
      font-size: 0.95rem;
      background-color: #fff;
    }

    .country-settings summary { cursor:pointer; font-weight:bold; color:#1e293b; }
    .country-settings form { margin-top:16px; padding-top:16px; border-top:1px solid var(--border-color); }
    .country-settings input[type="url"] { width:100%; box-sizing:border-box; padding:8px 10px; border:1px solid #cbd5e1; border-radius:6px; font:inherit; }
    .country-settings .btn { width:100%; margin-top:10px; }
    .settings-note { color:#64748b; font-size:0.8rem; line-height:1.6; }

    textarea {
      resize: vertical;
    }

    .action-btn-group {
      display: flex;
      gap: 8px;
      margin-bottom: 12px;
    }

    .btn {
      flex: 1;
      height: 42px;
      border: none;
      border-radius: 6px;
      font-weight: bold;
      font-size: 0.95rem;
      cursor: pointer;
      display: flex;
      align-items: center;
      justify-content: center;
      transition: background-color 0.2s;
    }

    .btn-primary { background: var(--primary-color); color: white; }
    .btn-success { background: var(--success-color); color: white; }
    .btn-danger { background: var(--danger-color); color: white; }
    .btn-secondary { background: #64748b; color: white; }

    .btn-aaa { background: var(--aaa); color: white; }
    .btn-bbb { background: var(--bbb); color: white; }

    .button-row {
      display: flex;
      flex-wrap: wrap;
      gap: 8px;
      align-items: center;
    }

    .button-row .btn {
      white-space: nowrap;
    }

    .btn-submit {
      width: 100%;
      height: 50px;
      font-size: 1.1rem;
      margin-top: 10px;
    }

    .form-group {
      margin-bottom: 10px;
    }

    .alert {
      padding: 10px 15px;
      border-radius: 8px;
      margin-bottom: 15px;
      font-size: 0.9rem;
      line-height: 1.4;
    }
    .alert-success { background-color: #d4edda; color: #155724; border: 1px solid #c3e6cb; }
    .alert-danger { background-color: #f8d7da; color: #721c24; border: 1px solid #f5c6cb; }
    .alert-info { background-color: #d1ecf1; color: #0c5460; border: 1px solid #bee5eb; }

    /* マップ表示設定 */
    .map-container {
      width: 100%;
      background: #e0f2fe;
      padding: 5px 0;
      border-radius: 8px;
      text-align: center;
      box-sizing: border-box;
    }

    #islandMap {
      width: 100%;
      max-width: 600px;
      margin: 0 auto;
    }

    #mapBody {
      width: 100%;
      line-height: 0;
      font-size: 0;
      white-space: nowrap;
    }

    .map-link {
      display: inline-block;
      width: 4.4%;
    }

    .mapchip {
      width: 100%;
      height: auto;
      vertical-align: bottom;
      cursor: pointer;
    }

    .subchip {
      width: 2.2%;
      height: auto;
      vertical-align: bottom;
    }

    /* 地形情報表示ブロック */
    .cell-info-card {
      margin-top: 10px;
      padding: 10px;
      background: #f8fafc;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      font-size: 0.88rem;
    }
    .cell-info-grid {
      display: grid;
      grid-template-columns: 1fr 1fr;
      gap: 6px;
      margin-top: 4px;
    }
    .cell-info-item {
      background: #fff;
      padding: 6px 8px;
      border-radius: 4px;
      border: 1px solid #e2e8f0;
    }

    /* --- [1] 統計情報用のテーブルスタイル（従来の表デザインをそのまま維持） --- */
    .stat-table-wrapper {
      width: 100%;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin-bottom: 10px;
    }

    .stat-table {
      width: 100% !important;
      border-collapse: collapse !important;
      font-size: 0.82rem !important;
      margin: 5px 0 !important;
      background-color: #ffffff !important;
      border-radius: 8px !important;
      overflow: hidden !important;
      border: 1px solid var(--border-color) !important;
    }

    .stat-table th {
      background-color: #f1f5f9 !important;
      color: #334155 !important;
      font-weight: 600 !important;
      padding: 8px 10px !important;
      text-align: center !important;
      border: 1px solid #e2e8f0 !important;
      white-space: nowrap;
    }

    .stat-table td {
      padding: 6px 8px !important;
      border: 1px solid #e2e8f0 !important;
      color: #333 !important;
      text-align: center !important;
    }

    /* --- [2] スマホUIに自然に溶け込むフラットなテーブルスタイル（統計情報以外） --- */
    .seamless-scroll-view {
      width: 100%;
      max-height: 380px;
      overflow-y: auto;
      overflow-x: auto;
      -webkit-overflow-scrolling: touch;
      margin-bottom: 12px;
    }

    .custom-mirrored-table {
      width: 100% !important;
      border-collapse: collapse !important;
      font-size: 0.88rem !important;
      margin: 0 !important;
      background-color: transparent !important;
      border: none !important;
    }

    .custom-mirrored-table th {
      background-color: #f8fafc !important;
      color: #475569 !important;
      font-weight: 600 !important;
      padding: 10px 8px !important;
      text-align: left !important;
      border: none !important;
      border-bottom: 2px solid #e2e8f0 !important;
      font-size: 0.8rem !important;
      white-space: nowrap;
    }

    .custom-mirrored-table td {
      padding: 10px 8px !important;
      border: none !important;
      border-bottom: 1px solid #f1f5f9 !important;
      color: #334155 !important;
      text-align: left !important;
      vertical-align: middle !important;
      line-height: 1.4 !important;
    }

    .custom-mirrored-table tr:last-child td {
      border-bottom: none !important;
    }

    .custom-mirrored-table tr:hover {
      background-color: #f8fafc !important;
    }

    .sub-label {
      display: block;
      font-size: 0.8rem;
      color: #64748b;
      font-weight: bold;
      margin-bottom: 8px;
    }

    /* コマンド一覧 */
    .command-list {
      font-size: 0.85rem;
      background: #f8fafc;
      border: 1px solid var(--border-color);
      border-radius: 8px;
      padding: 5px;
    }

    .command-item {
      padding: 8px 10px;
      border-bottom: 1px solid #f1f5f9;
      display: flex;
      align-items: center;
      cursor: pointer;
    }

    .command-item:last-child {
      border-bottom: none;
    }

    .command-item:hover {
      background-color: #f1f5f9;
    }

    .command {
      font-weight: bold;
      color: #2563eb;
    }

    .status-badge {
      font-weight: bold;
      padding: 4px 8px;
      border-radius: 4px;
      display: inline-block;
      margin-bottom: 8px;
      font-size: 0.85rem;
    }
    .status-sent { background: #d4edda; color: #155724; }
    .status-unsent { background: #f8d7da; color: #721c24; }

    .color-picker-group {
      display: flex;
      flex-wrap: wrap;
      gap: 6px;
      align-items: center;
      margin: 8px 0;
    }

    /* 選択座標のコマンド候補は文字幅に合わせて詰めて表示する */
    #commandSuggestList {
      display: flex;
      flex-wrap: wrap;
      align-items: center;
      gap: 5px;
    }

    #commandSuggestList .suggest-command-btn {
      flex: 0 0 auto;
      width: auto;
      min-width: 0;
      height: 34px;
      padding: 0 9px;
      font-size: 0.82rem;
      white-space: nowrap;
    }
    /* RSSニュース: ログインとは独立して取得する */
    .news-toolbar { display:flex; align-items:center; gap:10px; margin-bottom:8px; }
    .news-toolbar h3 { flex:1; margin:0; border:0; padding:0; }
    .news-control { background:#f1f5f9; color:#334155; border:1px solid var(--border-color); border-radius:6px; padding:6px 10px; cursor:pointer; }
    .news-ticker { overflow:hidden; min-width:0; padding:10px 0; font-size:0.75rem; line-height:1.6; }
    .news-ticker .news-publisher { font-size:inherit; }
    .news-track { display:flex; width:max-content; animation:news-scroll var(--news-duration, 60s) linear infinite; }
    .news-group { display:flex; flex-shrink:0; gap:32px; padding-right:32px; }
    .news-group > * { white-space:nowrap; }
    #newsCard a { color:#1e40af; text-decoration:none; }
    #newsCard a:hover { text-decoration:underline; }
    #newsCard a:focus-visible, #newsCard summary:focus-visible, .news-control:focus-visible { outline:2px solid var(--primary-color); outline-offset:3px; }
    #newsCard details { border-top:1px solid var(--border-color); margin-top:6px; padding-top:10px; }
    #newsCard summary { cursor:pointer; font-size:0.85rem; font-weight:bold; color:#475569; }
    .recent-news { list-style:none; padding:0; margin:10px 0 0; max-height:360px; overflow-y:auto; }
    .recent-news li { display:flex; flex-direction:column; gap:4px; padding:10px 0; border-bottom:1px solid var(--border-color); font-size:0.9rem; line-height:1.6; overflow-wrap:anywhere; }
    .recent-news li:last-child { border:0; }
    .recent-news time, .news-publisher, #newsStatus { font-size:0.75rem; color:#64748b; }
    #newsStatus:empty { display:none; }
    @keyframes news-scroll { to { transform:translateX(-50%); } }
    @media (prefers-reduced-motion:reduce) {
      .news-track { animation:none; }
      .news-ticker { overflow-x:auto; }
      .news-group[aria-hidden] { display:none; }
    }

.flugel-clock{display:flex;align-items:center;justify-content:center;flex-wrap:wrap;gap:6px 12px;padding:12px 15px;font-variant-numeric:tabular-nums}.flugel-clock-label,.flugel-clock-turn{font-size:.8rem;color:#64748b}.flugel-clock strong{font-size:1.05rem;color:#1e293b}

    /* PC: 入力・地図・計画を一目で操作できる3カラムにする。 */
    .desktop-columns { display: none; }

    @media (min-width: 1200px) {
      body {
        padding: 20px;
      }

      .container {
        max-width: 1680px;
      }

      #InputPlan {
        display: contents;
      }

      .desktop-columns {
        display: grid;
        grid-template-columns: minmax(300px, 1fr) minmax(470px, 1.45fr) minmax(300px, 1fr);
        gap: 18px;
        align-items: start;
      }

      .desktop-column {
        display: flex;
        flex-direction: column;
        gap: 18px;
      }

      .desktop-column > .card {
        margin-bottom: 0;
      }

      #islandMap {
        max-width: 700px;
      }
    }

