:root {
  --bg: #eef1f4;
  --bg-accent: #dce3ea;
  --surface: #ffffff;
  --panel: #f4f7fa;
  --border: #c5ced8;
  --border-strong: #8a97a8;
  --primary: #b71c1c;
  --primary-dark: #8e0000;
  --arrive: #1565c0;
  --arrive-dark: #0d47a1;
  --neutral: #455a64;
  --neutral-dark: #37474f;
  --text: #1c2733;
  --muted: #5c6b7a;
  --ok: #2e7d32;
  --ok-bg: #e8f5e9;
  --err: #c62828;
  --err-bg: #ffebee;
  --info-bg: #eceff1;
  --radius: 8px;
  --font: "IBM Plex Sans JP", "Hiragino Sans", "Noto Sans JP", sans-serif;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  min-height: 100%;
  font-family: var(--font);
  background:
    linear-gradient(180deg, var(--bg-accent) 0%, var(--bg) 40%, #e8ecf0 100%);
  color: var(--text);
}

body {
  padding: 16px 14px 40px;
}

.app {
  max-width: 440px;
  margin: 0 auto;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 18px 16px 22px;
  box-shadow: 0 1px 3px rgba(28, 39, 51, 0.08);
}

.brand {
  text-align: left;
  margin-bottom: 18px;
  padding-bottom: 14px;
  border-bottom: 2px solid #1a237e;
}

.brand__badge {
  display: inline-block;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: #fff;
  background: #1a237e;
  padding: 3px 8px;
  border-radius: 3px;
  margin-bottom: 8px;
  font-weight: 700;
}

.brand__title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 0.02em;
  color: #1a237e;
}

.brand__sub {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
}

.field {
  margin-bottom: 14px;
}

.field label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 6px;
  letter-spacing: 0.04em;
}

.field input {
  width: 100%;
  padding: 12px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
}

.field input:focus {
  outline: 2px solid #1a237e;
  outline-offset: 1px;
  border-color: #1a237e;
}

.actions {
  display: grid;
  gap: 10px;
  margin-top: 8px;
}

.actions--split {
  grid-template-columns: 1fr 1fr;
}

.field textarea {
  width: 100%;
  min-height: 72px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--panel);
  color: var(--text);
  font-size: 16px;
  font-family: inherit;
  resize: vertical;
}

.field textarea:focus {
  outline: 2px solid #1a237e;
  outline-offset: 1px;
  border-color: #1a237e;
}

.btn--test {
  background: var(--neutral);
}

.btn--prod {
  background: var(--primary);
}

.dest-switch .btn.is-active {
  box-shadow: inset 0 0 0 3px rgba(255, 255, 255, 0.85);
}

.dest-switch .btn:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

.btn {
  appearance: none;
  border: none;
  border-radius: var(--radius);
  padding: 16px 14px;
  font-size: 17px;
  font-weight: 700;
  font-family: inherit;
  color: #fff;
  cursor: pointer;
  min-height: 56px;
  transition: opacity 0.15s ease, transform 0.08s ease;
}

.btn:active { transform: scale(0.99); }
.btn:disabled { opacity: 0.5; cursor: not-allowed; }

.btn--dispatch {
  background: var(--primary);
}

.btn--location {
  background: var(--arrive);
}

.btn--withdraw {
  background: var(--neutral);
}

.status {
  margin-top: 16px;
  padding: 12px;
  border-radius: var(--radius);
  background: var(--info-bg);
  border: 1px solid var(--border);
  font-size: 13px;
  line-height: 1.5;
  min-height: 3.2em;
  white-space: pre-wrap;
  color: var(--text);
}

.status--ok {
  background: var(--ok-bg);
  border-color: #a5d6a7;
  color: var(--ok);
}

.status--err {
  background: var(--err-bg);
  border-color: #ef9a9a;
  color: var(--err);
}

.status--info {
  color: var(--muted);
}

.hint {
  margin-top: 8px;
  font-size: 12px;
  color: var(--muted);
  line-height: 1.5;
}

.hint code {
  font-size: 11px;
  word-break: break-all;
}

.form-card {
  margin-top: 8px;
}

.form-card .btn {
  width: 100%;
  margin-top: 8px;
}

.userbar {
  margin-bottom: 10px;
}

.field--readonly input {
  background: #e8eef4;
  border-color: var(--border);
  color: #334155;
  cursor: default;
}

.btn-link {
  appearance: none;
  border: none;
  background: transparent;
  color: #1a237e;
  font-size: 12px;
  font-family: inherit;
  text-decoration: underline;
  cursor: pointer;
  padding: 4px 0 8px;
  display: inline-block;
}

.panel-grid {
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-btn {
  appearance: none;
  border: 1px solid var(--border);
  background: var(--panel);
  color: var(--text);
  border-radius: 6px;
  min-height: 42px;
  padding: 8px 8px;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
}

.panel-btn.is-active {
  border-color: #1a237e;
  background: #e8eaf6;
  color: #1a237e;
  font-weight: 700;
}

.panel-btn--status {
  min-height: 48px;
  font-weight: 700;
  font-size: 12px;
  line-height: 1.3;
}

.panel-btn--status.is-active {
  border-color: var(--primary);
  background: #ffebee;
  color: var(--primary);
}

.preview {
  margin-top: 4px;
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--text);
  white-space: pre-wrap;
  font-size: 15px;
  font-weight: 600;
  min-height: 3em;
}

.field-row {
  display: grid;
  gap: 8px;
  margin-top: 8px;
}

/* --- 状況ボタン（4区分） --- */
.panel-grid--status {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

/* --- 確認事項（複数選択） --- */
.panel-grid--tags {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.panel-btn--tag.is-active {
  border-color: #1565c0;
  background: #e3f2fd;
  color: #0d47a1;
  font-weight: 700;
}

/* --- スマホ狭幅 --- */
@media (max-width: 390px) {
  .panel-grid:not(.panel-grid--status) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* --- タブレット縦（Pixel Tab 等） --- */
@media (min-width: 600px) {
  body {
    padding: 20px 24px 48px;
  }

  .app {
    max-width: 680px;
    padding: 22px 22px 28px;
  }

  .brand__title {
    font-size: 26px;
  }

  .userbar {
    display: flex;
    align-items: flex-end;
    justify-content: space-between;
    gap: 16px;
  }

  .userbar .field {
    flex: 1;
    margin-bottom: 0;
  }

  .panel-grid:not(.panel-grid--status) {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .panel-btn {
    min-height: 46px;
    font-size: 14px;
  }

  .panel-btn--status {
    min-height: 52px;
    font-size: 15px;
  }

  .actions:not(.actions--split) {
    grid-template-columns: repeat(3, 1fr);
  }

  .preview {
    font-size: 16px;
    padding: 14px 16px;
  }

  /* 出火報ページ：タブレットで文字・ボタンを一回り大きく（1カラムのまま） */
  .app--fire {
    max-width: 760px;
  }

  .app--fire .brand__badge {
    font-size: 13px;
    padding: 4px 10px;
  }

  .app--fire .brand__title {
    font-size: 30px;
  }

  .app--fire .brand__sub {
    font-size: 16px;
  }

  .app--fire .field label {
    font-size: 15px;
    margin-bottom: 8px;
  }

  .app--fire .field input,
  .app--fire .field textarea {
    font-size: 18px;
    padding: 14px 14px;
  }

  .app--fire .field textarea {
    min-height: 88px;
  }

  .app--fire .hint {
    font-size: 14px;
  }

  .app--fire .btn-link {
    font-size: 14px;
  }

  .app--fire .panel-btn {
    min-height: 52px;
    font-size: 16px;
    padding: 10px 10px;
  }

  .app--fire .panel-btn--status {
    min-height: 58px;
    font-size: 17px;
  }

  .app--fire .panel-btn--tag {
    min-height: 52px;
    font-size: 16px;
  }

  .app--fire .preview {
    font-size: 18px;
    padding: 16px 18px;
  }

  .app--fire .btn {
    min-height: 62px;
    font-size: 19px;
  }

  .app--fire .status {
    font-size: 15px;
    padding: 14px;
  }

  .app--fire .field {
    margin-bottom: 18px;
  }
}

/* --- タブレット横・広い画面 --- */
@media (min-width: 900px) {
  body {
    padding: 28px 32px 56px;
  }

  .app {
    max-width: 920px;
    padding: 28px 28px 32px;
  }

  .panel-grid:not(.panel-grid--status) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }

  .btn {
    min-height: 58px;
    font-size: 18px;
  }

  .app--fire {
    max-width: 880px;
  }

  .app--fire .brand__title {
    font-size: 32px;
  }

  .app--fire .brand__sub {
    font-size: 17px;
  }

  .app--fire .field label {
    font-size: 16px;
  }

  .app--fire .field input,
  .app--fire .field textarea {
    font-size: 19px;
  }

  .app--fire .panel-btn {
    min-height: 56px;
    font-size: 17px;
  }

  .app--fire .panel-btn--status {
    min-height: 64px;
    font-size: 18px;
  }

  .app--fire .preview {
    font-size: 19px;
  }

  .app--fire .btn {
    min-height: 66px;
    font-size: 20px;
  }

  .app--fire .status {
    font-size: 16px;
  }
}

@media (min-width: 1200px) {
  .app {
    max-width: 1040px;
  }

  .panel-grid:not(.panel-grid--status) {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }

  .app--fire {
    max-width: 960px;
  }

  .app--fire .panel-grid:not(.panel-grid--status) {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}
