* { box-sizing: border-box; }
body { font-family: sans-serif; margin: 0; padding: 16px; color: #222; background: #fafafa; }
/* input/select/textarea の見た目をOS・ブラウザによらず統一する。特にiOS Safariは
   標準のselect・input[type=date]に角丸・グレー背景・青文字の独自デザインを強制的に
   適用するため、明示的にリセットしないと機種ごとに見た目がバラバラになる。 */
input, select, textarea {
  -webkit-appearance: none;
  -moz-appearance: none;
  appearance: none;
  background-color: #fff;
  color: #222;
  border: 1px solid #ccc;
  border-radius: 4px;
  font-family: inherit;
  line-height: 1.4;
}
/* input[type=date]は、iOS Safariで値が空のとき内部の高さが縮んでしまう挙動があるため、
   未入力時でも他の入力欄と同じ高さになるよう明示的に指定する（textareaは複数行で
   伸縮させたいため対象外）。 */
input, select {
  min-height: 2.5em;
}
select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath fill='%23666' d='M6 8L0 0h12z'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 10px center;
  background-size: 10px 7px;
  padding-right: 26px;
}
input:disabled, select:disabled, textarea:disabled {
  background-color: #f0f0f0;
  color: #888;
}
h2 { margin: 0 0 12px; font-size: 18px; }
.badge { display: inline-block; background: #e8f5e9; color: #2e7d32; padding: 2px 10px; border-radius: 12px; font-size: 12px; }
.toolbar { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; align-items: center; }
.toolbar input, .toolbar select { padding: 6px 8px; font-size: 14px; }
.action-toolbar { display: flex; flex-wrap: wrap; gap: 6px; margin: 6px 0 14px; }
.btn-compact { padding: 4px 10px; font-size: 12px; }
.stepper-row { display: flex; gap: 6px; align-items: center; }
.stepper-row input { flex: 1; min-width: 0; text-align: center; }
.stepper-row button { padding: 6px 14px; font-size: 16px; line-height: 1; }
/* ＋/－ボタンを追加したため、ブラウザ標準の上下スピナー（PC版Chrome等でのみ表示され、
   タブレットのSafariには元々表示されない）は二重に見えるので非表示にする */
.stepper-row input::-webkit-outer-spin-button,
.stepper-row input::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
.stepper-row input[type="number"] { -moz-appearance: textfield; }
button { padding: 8px 14px; font-size: 14px; border: none; border-radius: 6px; cursor: pointer; }
.btn-primary { background: #1a73e8; color: #fff; }
.btn-secondary { background: #e0e0e0; color: #333; }
.btn-danger { background: #fff; color: #d93025; border: 1px solid #d93025; margin-right: auto; }
.btn-toggle { background: #fff; border: 1px solid #ccc; border-radius: 16px; padding: 6px 12px; margin: 3px; font-size: 13px; }
.btn-toggle.selected { background: #1a73e8; color: #fff; border-color: #1a73e8; }
#calculatorButtons { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
#calculatorButtons button { height: 42px; margin: 0; }
.calc-history-item { display: inline-block; background: #eef6ff; border-radius: 12px; padding: 4px 10px; margin: 3px; font-size: 13px; cursor: pointer; border: none; }
table { width: 100%; border-collapse: collapse; background: #fff; font-size: 13px; }
th, td { border: 1px solid #ddd; padding: 6px 8px; text-align: left; }
th { background: #f0f0f0; }
.text-right { text-align: right; }
tr.row:hover { background: #eef6ff; cursor: pointer; }
tr.row.status-complete { background: #e8f5e9; }
tr.row.status-complete:hover { background: #d5ecd7; }
.status-tag { font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.status-tag.complete { background: #2e7d32; color: #fff; }
.status-tag.pending { background: #eee; color: #777; }
.hidden { display: none !important; }
.invisible { visibility: hidden; }
.overlay { position: fixed; inset: 0; background: rgba(0,0,0,0.35); display: flex; align-items: flex-start; justify-content: center; padding: 24px 12px; overflow-y: auto; }
.panel { background: #fff; border-radius: 10px; padding: 20px; max-width: 640px; width: 100%; }
.panel h3 { margin-top: 0; }
fieldset { border: 1px solid #ddd; border-radius: 8px; margin-bottom: 14px; }
legend { font-size: 13px; color: #666; padding: 0 6px; }
.field-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 8px; }
.field { flex: 1 1 140px; }
.field label { display: block; font-size: 12px; color: #666; margin-bottom: 3px; }
.field input, .field select, .field textarea { width: 100%; padding: 6px; font-size: 14px; font-family: inherit; }
.field textarea { resize: vertical; }
.product-chip { display: inline-flex; align-items: center; background: #eef6ff; border-radius: 14px; padding: 4px 10px; margin: 3px; font-size: 13px; }
.product-chip button { background: none; border: none; color: #1a73e8; padding: 0 0 0 6px; font-size: 13px; cursor: pointer; }
.form-actions { display: flex; justify-content: flex-end; gap: 8px; margin-top: 16px; }
.note { font-size: 12px; color: #888; }
#loginArea { text-align: center; padding: 60px 16px; }
