:root {
  color-scheme: light;
  --bg: #f6f7f9;
  --panel: #ffffff;
  --text: #17202a;
  --muted: #627083;
  --border: #d8dee8;
  --accent: #0f6b5f;
  --accent-hover: #0a5a50;
  --danger: #b42318;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Yu Gothic UI", "Yu Gothic", "Hiragino Sans", Meiryo, sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

.app {
  width: min(1120px, calc(100vw - 48px));
  margin: 32px auto;
}

.header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--accent);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 28px;
  line-height: 1.2;
  letter-spacing: 0;
}

.status {
  min-width: 92px;
  padding: 8px 12px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: var(--panel);
  color: var(--muted);
  text-align: center;
  font-size: 13px;
  font-weight: 700;
}

.status.connected {
  border-color: rgba(15, 107, 95, 0.35);
  color: var(--accent);
}

.panel {
  margin-bottom: 14px;
  padding: 18px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--panel);
}

label {
  display: block;
  margin-bottom: 8px;
  font-size: 14px;
  font-weight: 700;
}

.inline {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

input,
select,
textarea {
  width: 100%;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
}

input,
select {
  height: 42px;
  padding: 0 12px;
}

textarea {
  display: block;
  min-height: 220px;
  padding: 12px;
  resize: vertical;
  line-height: 1.5;
}

button {
  height: 42px;
  padding: 0 16px;
  border: 0;
  border-radius: 6px;
  background: var(--accent);
  color: #fff;
  cursor: pointer;
  font-weight: 700;
}

button:hover:not(:disabled) {
  background: var(--accent-hover);
}

button:disabled {
  cursor: not-allowed;
  opacity: 0.45;
}

.actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.progress-panel {
  margin-bottom: 0;
}

.progress-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

progress {
  width: 100%;
  height: 14px;
  accent-color: var(--accent);
}

pre {
  min-height: 140px;
  max-height: 340px;
  margin: 14px 0 0;
  padding: 12px;
  overflow: auto;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #111827;
  color: #d6e4ff;
  font-size: 13px;
  line-height: 1.5;
  white-space: pre-wrap;
}

.details {
  margin-top: 12px;
}

.details summary {
  cursor: pointer;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.error {
  color: var(--danger);
}

@media (max-width: 720px) {
  .app {
    width: min(100% - 28px, 1120px);
    margin: 18px auto;
  }

  .header {
    display: block;
    margin-bottom: 14px;
  }

  h1 {
    font-size: 24px;
  }

  .status {
    width: fit-content;
    margin-top: 12px;
  }

  .panel {
    padding: 14px;
  }

  .inline {
    grid-template-columns: 1fr;
  }

  input,
  select,
  textarea {
    font-size: 16px;
  }

  button {
    width: 100%;
  }

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

  textarea {
    min-height: 260px;
  }

  .progress-row {
    align-items: flex-start;
    font-size: 13px;
  }

  pre {
    min-height: 160px;
    max-height: 300px;
    font-size: 12px;
  }
}
/* 仕様追加: 操作順と右寄せ */
.section-heading { display:flex; align-items:center; justify-content:space-between; gap:20px; }
.section-heading h2 { margin:0 0 4px; font-size:18px; }
.section-heading p { margin:0; color:var(--muted); }
.note { margin:12px 0 0; color:var(--muted); line-height:1.6; }
.actions, .gsc-actions, .ga4-actions { justify-content:flex-end; }
.actions button:first-child, .gsc-actions button:first-child, .ga4-actions button:first-child { margin-left:auto; }
button { white-space:nowrap; }
@media (max-width:720px) { .section-heading { display:block; } .section-heading button { display:block; margin:12px 0 0 auto; width:auto; } .actions button:first-child, .gsc-actions button:first-child, .ga4-actions button:first-child { margin-left:0; } }

/* Shared polish: keep Japanese labels and controls on one type system. */
.app, .app button, .app input, .app select, .app textarea { font-family: inherit; }
.app button { border-radius: 10px; box-shadow: 0 8px 18px -12px rgba(15, 107, 95, .8); transition: background .18s ease, transform .18s ease, box-shadow .18s ease; }
.app button:hover:not(:disabled) { transform: translateY(-1px); box-shadow: 0 10px 20px -12px rgba(15, 107, 95, .95); }
/* Numbered steps use one visual hierarchy across every tool. */
.step-label { display: block; margin-bottom: 10px; font-size: 18px !important; line-height: 1.3; font-weight: 800 !important; letter-spacing: -0.01em; }