/* Topcoat のページを軽量な共有スタイルで整える。 */
:root {
  font-family:
    ui-sans-serif,
    system-ui,
    -apple-system,
    "Hiragino Sans",
    sans-serif;
  color: #172033;
  background: #f5f7fb;
  line-height: 1.5;
}
* {
  box-sizing: border-box;
}
body {
  margin: 0;
}
.shell {
  max-width: 920px;
  margin: 0 auto;
  padding: 32px 20px 72px;
}
.page-header {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-start;
  margin-bottom: 20px;
}
h1 {
  font-size: 28px;
  line-height: 1.2;
  margin: 4px 0 8px;
}
h2 {
  font-size: 15px;
  margin: 0;
  font-family: ui-monospace, SFMono-Regular, monospace;
}
.eyebrow {
  color: #4f46e5;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin: 0;
}
.muted,
.help {
  color: #667085;
  font-size: 13px;
}
.panel,
.step-card {
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 14px;
  box-shadow: 0 3px 14px #243b5310;
  padding: 18px;
  margin: 14px 0;
}
.endpoint-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}
.label,
.field > span {
  color: #566174;
  font-size: 12px;
  font-weight: 700;
  display: block;
  margin-bottom: 5px;
}
.endpoint {
  font-family: ui-monospace, monospace;
  font-size: 13px;
  margin: 0;
  overflow-wrap: anywhere;
}
.segmented {
  display: flex;
  border: 1px solid #d5dbe6;
  border-radius: 8px;
  padding: 3px;
  background: #f3f5f8;
}
.segmented button {
  border: 0;
  background: transparent;
  border-radius: 6px;
  padding: 7px 14px;
  color: #566174;
  cursor: pointer;
}
.segmented button.active {
  background: #4f46e5;
  color: #fff;
}
.history-row {
  display: flex;
  gap: 12px;
  align-items: end;
}
.grow {
  flex: 1;
}
.field textarea,
select,
input:not([type="checkbox"]) {
  width: 100%;
  border: 1px solid #cdd5e1;
  border-radius: 7px;
  padding: 9px 10px;
  font: inherit;
  font-size: 14px;
  background: #fff;
  color: #172033;
}
.state-bar {
  background: #eef2ff;
  border: 1px solid #c7d2fe;
  border-radius: 12px;
  padding: 12px 14px;
  margin: 14px 0;
  display: grid;
  gap: 8px;
}
.state-bar label {
  display: flex;
  align-items: center;
  gap: 12px;
}
.state-bar label span {
  width: 105px;
  color: #4338ca;
  font:
    12px ui-monospace,
    monospace;
}
.button {
  border: 1px solid transparent;
  border-radius: 7px;
  padding: 9px 13px;
  font-weight: 700;
  cursor: pointer;
  font-size: 13px;
}
.button:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}
.button-primary {
  background: #4f46e5;
  color: #fff;
}
.button-secondary {
  background: #fff;
  border-color: #cdd5e1;
  color: #344054;
}
.button-danger {
  background: #fff;
  border-color: #fecaca;
  color: #b42318;
}
.wide {
  width: 100%;
  margin-top: 8px;
}
.section-title {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: center;
}
.section-title > div:first-child {
  display: flex;
  align-items: center;
  gap: 10px;
}
.step-number {
  display: inline-grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: #4f46e5;
  color: #fff;
  font-weight: 700;
  font-size: 13px;
  flex-shrink: 0;
}
.method {
  padding: 2px 6px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
}
#building-part-sync-json {
  font-family: ui-monospace, monospace;
}
.method-get {
  background: #dbeafe;
  color: #1d4ed8;
}
.method-post {
  background: #dcfce7;
  color: #166534;
}
.method-put {
  background: #fef3c7;
  color: #92400e;
}
.section-title h2,
#webhook-url {
  overflow-wrap: anywhere;
}
.input-action {
  display: flex;
  align-items: end;
  gap: 8px;
}
.input-action .field {
  flex: 1;
  min-width: 0;
}
.input-action button {
  flex-shrink: 0;
}
.webhook > .input-action {
  margin: 12px 0;
  align-items: center;
}
.webhook > .input-action > p {
  min-width: 0;
  margin: 0;
}
.step-form {
  display: grid;
  gap: 11px;
  margin-top: 15px;
}
.step-actions,
.actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.result {
  background: #111827;
  color: #a7f3d0;
  border-radius: 8px;
  padding: 13px;
  overflow: auto;
  max-height: 320px;
  white-space: pre-wrap;
  word-break: break-word;
  font:
    12px ui-monospace,
    monospace;
  margin: 12px 0 0;
}
.error {
  color: #b42318;
  font-size: 13px;
}
.badge {
  display: inline-block;
  background: #fff7ed;
  color: #c2410c;
  border: 1px solid #fed7aa;
  border-radius: 5px;
  padding: 3px 7px;
  font-size: 11px;
}
.toggle {
  display: inline-flex;
  align-items: center;
  justify-self: start;
  gap: 7px;
  font-size: 13px;
}
.toggle input {
  flex: none;
  margin: 0;
}
#building-part-status,
#building-part-result {
  margin: 0;
}
#building-part-status:empty {
  display: none;
}
.events {
  display: grid;
  gap: 9px;
}
.event {
  border: 1px solid #e1e6ef;
  border-radius: 8px;
  padding: 10px;
}
.event summary {
  cursor: pointer;
  font-weight: 700;
  font-size: 13px;
}
.event pre {
  margin: 9px 0 0;
}
.login-shell {
  min-height: 100vh;
  display: grid;
  place-items: center;
  padding: 24px;
}
.login-card {
  width: min(100%, 390px);
  background: #fff;
  border: 1px solid #e1e6ef;
  border-radius: 14px;
  padding: 26px;
  box-shadow: 0 6px 28px #243b5312;
}
.login-card h1 {
  margin-top: 8px;
}
.login-card form {
  display: grid;
  gap: 14px;
  margin-top: 22px;
}
@media (max-width: 620px) {
  .page-header,
  .history-row {
    display: grid;
  }
  .endpoint-panel {
    grid-template-columns: 1fr;
  }
  .state-bar label {
    display: grid;
    gap: 4px;
  }
  .state-bar label span {
    width: auto;
  }
}
