body { 
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; 
    display: flex; 
    flex-direction: column; 
    align-items: center; 
    justify-content: center;
    background: #0f172a; /* 深みのあるモダンなダークネイビー */
    color: #f3f4f6;
    margin: 0;
    padding: 20px;
    touch-action: manipulation; 
    text-align: center;
}

h2 {
    text-align: center;
    width: 100%;
    color: #38bdf8; /* 鮮やかなシアンブルー */
    font-weight: 700;
    letter-spacing: 0.05em;
    text-shadow: 0 2px 4px rgba(0,0,0,0.3);
}

canvas { 
    border: 2px solid #38bdf8; 
    background: #ffffff; 
    cursor: crosshair; 
    box-shadow: 0 10px 25px -5px rgba(56, 189, 248, 0.2); 
    max-width: 100%; 
    height: auto; 
    touch-action: none; 
    display: block;
    margin: 0 auto;
    border-radius: 8px;
}

.controls { 
    margin-top: 15px; 
    display: flex; 
    gap: 8px; 
    flex-wrap: wrap; 
    justify-content: center; 
    max-width: 600px; 
    margin-left: auto;
    margin-right: auto;
}

button { 
    padding: 12px 14px; 
    cursor: pointer; 
    border-radius: 6px; 
    border: 1px solid #475569; 
    background: #1e293b; 
    color: #f8fafc;
    font-weight: bold; 
    font-size: 14px; 
    transition: all 0.2s ease;
    -webkit-tap-highlight-color: transparent; 
}

button:hover {
    background: #334155;
    border-color: #38bdf8;
    transform: translateY(-1px);
}

button:active { background: #0f172a; }
.active-tool { background: #f59e0b !important; color: #000 !important; border-color: #d97706; box-shadow: 0 0 10px rgba(245, 158, 11, 0.4); }

.info { 
    margin: 12px auto; 
    color: #94a3b8; 
    font-size: 0.9em; 
    line-height: 1.4; 
    text-align: center; 
    max-width: 560px;
}

.mode-btn { 
    background: linear-gradient(135deg, #0284c7, #0369a1); 
    color: white; 
    border: none; 
    padding: 14px 20px; 
    font-size: 16px; 
    margin-bottom: 15px; 
    width: 90%; 
    max-width: 400px; 
    display: block;
    margin-left: auto;
    margin-right: auto;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(2, 132, 199, 0.3);
    font-weight: bold;
}

.mode-btn:hover {
    background: linear-gradient(135deg, #0369a1, #075985);
}

/* フォーム・コンテナ用スタイル（ダークテーマに映えるモダンカードデザイン） */
.order-form-container, .confirm-container, .import-container { 
    background: #1e293b; 
    padding: 24px; 
    border-radius: 12px; 
    box-shadow: 0 10px 25px -5px rgba(0, 0, 0, 0.3); 
    width: 100%; 
    max-width: 560px; 
    margin: 20px auto 0 auto; 
    box-sizing: border-box; 
    text-align: left;
    border: 1px solid #334155;
}

.form-group { margin-bottom: 15px; display: flex; flex-direction: column; text-align: left; }
.form-group label { font-weight: bold; font-size: 0.9em; margin-bottom: 6px; color: #cbd5e1; }
.required { color: #f43f5e; }
.form-group input, .form-group textarea { 
    padding: 12px; 
    border: 1px solid #475569; 
    border-radius: 6px; 
    font-size: 14px; 
    width: 100%; 
    box-sizing: border-box; 
    background: #0f172a;
    color: #f8fafc;
}

.form-group input:focus, .form-group textarea:focus {
    outline: none;
    border-color: #38bdf8;
    box-shadow: 0 0 0 2px rgba(56, 189, 248, 0.2);
}

.error-msg { background: rgba(244, 63, 94, 0.15); color: #fda4af; padding: 10px; border-radius: 6px; margin-bottom: 15px; font-size: 0.9em; text-align: center; font-weight: bold; border: 1px solid rgba(244, 63, 94, 0.3); }

.form-actions, .confirm-actions { display: flex; gap: 10px; justify-content: center; margin-top: 20px; }
.btn-confirm { background: #0284c7; color: white; border: none; padding: 12px 24px; font-size: 1em; border-radius: 6px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.btn-confirm:hover { background: #0369a1; }

.btn-back { background: #64748b; color: white; border: none; padding: 12px 24px; font-size: 1em; border-radius: 6px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.btn-back:hover { background: #475569; }

.btn-submit { background: #10b981; color: white; border: none; padding: 12px 24px; font-size: 1em; border-radius: 6px; font-weight: bold; cursor: pointer; transition: background 0.2s; }
.btn-submit:hover { background: #059669; }

.confirm-box { background: #0f172a; border: 1px solid #334155; padding: 15px; border-radius: 8px; text-align: left; margin: 15px 0; font-size: 0.9em; color: #cbd5e1; }
.remarks-preview, .layout-preview { background: #1e293b; border: 1px solid #475569; color: #e2e8f0; padding: 10px; border-radius: 6px; margin-top: 5px; max-height: 120px; overflow-y: auto; white-space: pre-wrap; font-family: monospace; font-size: 0.85em; }

/* 天板サイズの入力（2D版） */
.panel-size { display: grid; grid-template-columns: auto 1fr 72px auto; gap: 8px 10px; align-items: center; max-width: 560px; margin: 0 auto 12px auto; background: #1e293b; border: 1px solid #334155; border-radius: 10px; padding: 12px 14px; box-sizing: border-box; width: 100%; text-align: left; }
.panel-size-title { grid-column: 1 / -1; font-weight: bold; font-size: 0.9em; color: #cbd5e1; }
.panel-size label { font-size: 0.85em; color: #cbd5e1; }
.panel-size input[type=range] { width: 100%; accent-color: #38bdf8; }
.panel-size input[type=number] { width: 100%; box-sizing: border-box; padding: 6px 8px; border: 1px solid #475569; border-radius: 6px; background: #0f172a; color: #f8fafc; font-size: 14px; text-align: right; }
.panel-size span { font-size: 0.85em; color: #94a3b8; }
