/* 見積ツール スタイル（スマホ優先・シンプル） */
* {
  box-sizing: border-box;
}
body {
  margin: 0;
  font-family: -apple-system, "Hiragino Kaku Gothic ProN", "Yu Gothic", Meiryo, sans-serif;
  color: #222;
  background: #f5f6f8;
  line-height: 1.6;
  font-size: 16px;
}
.hidden {
  display: none !important;
}
.screen {
  padding: 40px 16px;
  text-align: center;
  color: #555;
}

/* 開発バー */
.devbar {
  background: #fff3cd;
  border-bottom: 1px solid #ffe08a;
  padding: 8px 12px;
  font-size: 13px;
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.devbar input {
  padding: 4px 6px;
}

/* 403 */
#denied {
  max-width: 560px;
  margin: 0 auto;
}
.userid-box {
  display: flex;
  gap: 8px;
  align-items: center;
  justify-content: center;
  margin: 16px 0;
  flex-wrap: wrap;
}
.userid-box code {
  background: #fff;
  border: 1px solid #ccc;
  border-radius: 6px;
  padding: 10px 14px;
  font-size: 15px;
  word-break: break-all;
}

/* ヘッダ */
.app-header {
  background: #fff;
  border-bottom: 1px solid #e2e4e8;
  padding: 12px 16px;
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
}
.app-header h1 {
  font-size: 18px;
  margin: 0;
}
.whoami {
  font-size: 12px;
  color: #888;
}

/* フォーム */
form {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px;
}
.card {
  background: #fff;
  border: 1px solid #e2e4e8;
  border-radius: 10px;
  padding: 14px;
  margin-bottom: 12px;
}
.field {
  display: block;
  margin-bottom: 12px;
}
.field:last-child {
  margin-bottom: 0;
}
.label {
  display: block;
  font-weight: 600;
  font-size: 14px;
  margin-bottom: 4px;
}
.label em {
  color: #c8102e;
  font-style: normal;
  font-size: 12px;
  margin-left: 4px;
}
input[type="text"],
input[type="number"],
input[type="date"],
select,
textarea {
  width: 100%;
  padding: 10px;
  border: 1px solid #ccc;
  border-radius: 8px;
  font-size: 16px;
  font-family: inherit;
}
.size-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
}
.size-inputs input {
  width: 90px;
}
.radios {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}
.radios label,
.check {
  font-size: 15px;
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.check {
  display: flex;
  margin-bottom: 6px;
}
.hint {
  font-size: 12px;
  color: #888;
  margin: 6px 0 0;
}
#judgeResult {
  white-space: pre-line;
}
.err {
  color: #c0102e;
}
button {
  cursor: pointer;
  font-size: 15px;
  padding: 10px 14px;
  border: 1px solid #ccc;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
}
button:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}
button.primary {
  width: 100%;
  background: #c8102e;
  color: #fff;
  border: none;
  font-size: 17px;
  padding: 14px;
  border-radius: 10px;
  margin: 8px 0 40px;
}
.manual-row {
  display: flex;
  gap: 6px;
  margin-bottom: 6px;
}
.manual-row .m-label {
  flex: 2;
}
.manual-row .m-amount {
  flex: 1;
}
.manual-row button {
  flex: 0 0 auto;
}

/* 内訳 */
#breakdownBody {
  margin-top: 8px;
}
.bd-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 5px 0;
  border-bottom: 1px dashed #eee;
  font-size: 14px;
}
.bd-row span:last-child {
  white-space: nowrap;
}
.bd-row.discount {
  color: #c0392b;
}
.bd-row.total {
  font-weight: 700;
  font-size: 18px;
  border-bottom: none;
  border-top: 2px solid #333;
  margin-top: 4px;
  padding-top: 8px;
}
.bd-row.sub {
  color: #888;
  font-size: 12px;
  border-bottom: none;
}
.review-warn {
  margin-top: 10px;
  padding: 10px;
  border: 1px solid #f0b4bb;
  background: #fdeef0;
  border-radius: 8px;
  color: #c0102e;
  font-size: 13px;
}
.review-warn strong {
  display: block;
  margin-bottom: 4px;
}

/* 作成結果 */
.create-result {
  margin: -24px 0 40px;
}
.create-result .ok {
  font-weight: 600;
  color: #1a7a3a;
  margin: 0 0 8px;
}
.create-result .err {
  color: #c0102e;
  margin: 0;
}
.pdf-link {
  display: inline-block;
  padding: 10px 16px;
  background: #2c4a6e;
  color: #fff;
  text-decoration: none;
  border-radius: 8px;
  font-weight: 600;
}
.warn-line {
  color: #b8860b;
  font-size: 13px;
  margin: 6px 0 0;
}

/* 料金表エディタ */
.toggle {
  width: 100%;
  text-align: left;
  background: #eef1f5;
  border: 1px solid #d5dae1;
  font-weight: 600;
}
.primary-outline {
  background: #fff;
  color: #c8102e;
  border: 1.5px solid #c8102e;
  font-weight: 600;
  margin-top: 8px;
}
.price-title {
  font-size: 14px;
  margin: 14px 0 6px;
}
.table-scroll {
  overflow-x: auto;
}
.price-table {
  border-collapse: collapse;
  font-size: 12px;
}
.price-table th,
.price-table td {
  border: 1px solid #e2e4e8;
  padding: 2px;
  text-align: center;
}
.price-table th {
  background: #f5f6f8;
  white-space: nowrap;
  padding: 2px 6px;
}
.price-cell {
  width: 64px;
  padding: 4px;
  font-size: 13px;
  text-align: right;
}
.multi-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.multi-grid .mini {
  display: flex;
  flex-direction: column;
  font-size: 11px;
  color: #555;
}
.multi-grid .mini .price-cell {
  width: 80px;
}

/* 管理者 */
.admin {
  max-width: 640px;
  margin: 0 auto 40px;
}
.staff-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 8px;
  border: 1px solid #eee;
  border-radius: 6px;
  margin-bottom: 4px;
  font-size: 14px;
  word-break: break-all;
}
.staff-row.env {
  background: #f7f7f7;
  color: #666;
}
.add-staff {
  display: flex;
  gap: 6px;
  margin-top: 10px;
  flex-wrap: wrap;
}
.add-staff input {
  flex: 1;
  min-width: 120px;
}

/* 答え合わせ画面 */
.review-wrap {
  max-width: 640px;
  margin: 0 auto;
  padding: 12px;
}
.review-head {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.review-thumb {
  display: block;
  max-width: 100%;
  max-height: 220px;
  width: auto;
  border: 1px solid #e2e4e8;
  border-radius: 8px;
  margin: 6px 0 10px;
  background: #f5f6f8;
}
.review-card .field {
  margin-top: 10px;
}
.review-card .ok {
  font-weight: 600;
  color: #1a7a3a;
}
.back-link {
  margin: 8px 0 40px;
}
