/* 設定面板：桌機在右側；手機（≤640px）改成底部抽屜，不遮住時間卡。 */
.panel { position: fixed; z-index: 30; right: 12px; top: 12px; bottom: 12px; width: 340px; overflow: auto;
  background: #fff; border-radius: 20px; box-shadow: 0 18px 46px rgba(20, 40, 60, .25); padding: 12px 16px 18px; }
.panel[hidden] { display: none; }
.ph { display: flex; justify-content: space-between; align-items: center; font-size: 19px; }
.tabs { display: flex; gap: 6px; margin: 10px 0; }
.tab { flex: 1; min-height: 44px; border: 0; border-radius: 12px; background: #eef2f5; font: 700 16px inherit; cursor: pointer; }
.tab.on { background: var(--accent); color: #fff; }
.tpane[hidden] { display: none; }
.fld { display: flex; flex-direction: column; gap: 4px; margin: 10px 0; font-weight: 700; font-size: 15px; }
.fld input, .fld select { min-height: 44px; font-size: 17px; padding: 6px 10px; border: 1.5px solid #c8d3dc; border-radius: 10px; }
.fld input[type=range] { padding: 0; border: 0; }
.seg { border: 0; padding: 0; margin: 6px 0; display: flex; flex-wrap: wrap; gap: 8px; }
.seg legend { font-weight: 700; font-size: 15px; margin-bottom: 4px; }
.seg label, .chk { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; padding: 0 12px;
  border: 1.5px solid #c8d3dc; border-radius: 12px; cursor: pointer; }
.seg label:has(input:checked) { border-color: var(--accent); background: #e6f4ef; }
.chk { margin: 8px 0; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chips .btn { font-size: 16px; }
.lbl { margin: 10px 0 4px; font-weight: 700; font-size: 15px; }
.hint { color: #5b6472; font-size: 14px; margin: 6px 0; }
.selbox { background: #fffbe8; border: 1.5px solid #f1d37a; border-radius: 14px; padding: 4px 12px 12px; margin: 10px 0; }
body.mode-timer .only-date, body.mode-date .only-timer { display: none; }

@media (max-width: 640px) {
  .panel { left: 0; right: 0; top: auto; bottom: 0; width: 100%; max-height: 58vh; border-radius: 20px 20px 0 0;
    padding-bottom: max(18px, env(safe-area-inset-bottom)); animation: up .22s ease-out; }
  .panel::before { content: ""; display: block; width: 48px; height: 5px; border-radius: 3px; background: #cfd6dd; margin: 0 auto 6px; }
  @keyframes up { from { transform: translateY(100%); } }
}

.musicRow { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.musicRow .hint { margin: 0; flex: 1 1 120px; }
