/* WordPress テーマとの干渉を避けるため、すべて .stpl 配下に限定する */
.stpl {
  --stpl-fg: #1f2328;
  --stpl-muted: #59636e;
  --stpl-bg: #ffffff;
  --stpl-bg-sub: #f6f8fa;
  --stpl-border: #d1d9e0;
  --stpl-accent: #0969da;
  --stpl-ok: #1a7f37;
  --stpl-warn: #9a6700;
  --stpl-error: #d1242f;
  --stpl-strong-bg: #ddf4ff;
  --stpl-strong-fg: #0550ae;
  box-sizing: border-box;
  max-width: 100%;
  margin: 1.5em 0;
  padding: 16px;
  border: 1px solid var(--stpl-border);
  border-radius: 8px;
  background: var(--stpl-bg);
  color: var(--stpl-fg);
  font-size: 15px;
  line-height: 1.6;
}
.stpl *,
.stpl *::before,
.stpl *::after {
  box-sizing: border-box;
}
.stpl [hidden] {
  display: none !important;
}
.stpl .stpl-today {
  margin: 0 0 10px;
  font-size: 14px;
  font-weight: bold;
}
.stpl .stpl-form {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 8px 12px;
  margin: 0 0 10px;
}
.stpl .stpl-field {
  display: flex;
  flex-direction: column;
  gap: 2px;
  flex: 1 1 180px;
  min-width: 0;
  max-width: 100%;
}
.stpl .stpl-label {
  display: block;
  margin: 0;
  font-size: 14px;
  font-weight: bold;
}
.stpl .stpl-in,
.stpl .stpl-select,
.stpl .stpl-area {
  width: 100%;
  max-width: 100%;
  min-width: 0;
  margin: 0;
  padding: 6px 8px;
  border: 1px solid var(--stpl-border);
  border-radius: 6px;
  background: var(--stpl-bg);
  color: var(--stpl-fg);
  font: inherit;
  font-size: 16px;
  line-height: 1.5;
}
.stpl .stpl-select {
  font-size: 14px;
}
.stpl .stpl-area {
  font-family: ui-monospace, SFMono-Regular, Consolas, "Liberation Mono", monospace;
  font-size: 14px;
  resize: vertical;
}
.stpl .stpl-in[aria-invalid="true"],
.stpl .stpl-area[aria-invalid="true"] {
  border-color: var(--stpl-error);
}
.stpl .stpl-checks {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 16px;
  margin: 0 0 10px;
}
.stpl .stpl-fieldset .stpl-checks {
  margin: 0;
}
.stpl .stpl-check {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 14px;
  cursor: pointer;
}
.stpl .stpl-check input {
  width: 16px;
  height: 16px;
  margin: 0;
}
.stpl .stpl-fieldset {
  min-width: 0;
  margin: 0 0 10px;
  padding: 6px 10px 8px;
  border: 1px solid var(--stpl-border);
  border-radius: 6px;
}
.stpl .stpl-legend {
  padding: 0 4px;
  font-size: 14px;
  font-weight: bold;
}
.stpl .stpl-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 8px;
}
.stpl .stpl-btn {
  margin: 0;
  padding: 6px 14px;
  border: 1px solid var(--stpl-border);
  border-radius: 6px;
  background: var(--stpl-bg-sub);
  color: var(--stpl-fg);
  font: inherit;
  font-size: 14px;
  white-space: nowrap;
  cursor: pointer;
}
.stpl .stpl-btn:hover {
  border-color: var(--stpl-muted);
}
.stpl .stpl-btn-sub {
  background: transparent;
}
.stpl button:focus-visible,
.stpl input:focus-visible,
.stpl select:focus-visible,
.stpl textarea:focus-visible,
.stpl summary:focus-visible {
  outline: 2px solid var(--stpl-accent);
  outline-offset: 2px;
}
.stpl .stpl-hint,
.stpl .stpl-info,
.stpl .stpl-msg,
.stpl .stpl-note {
  margin: 0 0 8px;
  font-size: 13px;
  overflow-wrap: anywhere;
}
.stpl .stpl-hint,
.stpl .stpl-note {
  color: var(--stpl-muted);
}
.stpl .stpl-info {
  padding: 6px 8px;
  border-radius: 6px;
  background: var(--stpl-bg-sub);
  font-size: 14px;
}
.stpl .stpl-info:empty,
.stpl .stpl-msg:empty {
  display: none;
}
.stpl .stpl-msg {
  font-size: 14px;
}
.stpl .stpl-msg[data-kind="ok"] {
  color: var(--stpl-ok);
}
.stpl .stpl-msg[data-kind="warn"] {
  color: var(--stpl-warn);
}
.stpl .stpl-msg[data-kind="error"] {
  color: var(--stpl-error);
  font-weight: bold;
}
.stpl .stpl-details {
  margin: 0 0 10px;
  border: 1px solid var(--stpl-border);
  border-radius: 6px;
}
.stpl .stpl-summary {
  padding: 6px 10px;
  font-size: 14px;
  font-weight: bold;
  cursor: pointer;
}
.stpl .stpl-summary:hover {
  background: var(--stpl-bg-sub);
}
.stpl .stpl-details-body {
  padding: 0 10px 10px;
}
.stpl .stpl-table {
  width: 100%;
  margin: 0 0 8px;
  border-collapse: collapse;
  font-size: 14px;
}
.stpl .stpl-caption {
  margin: 0 0 4px;
  font-weight: bold;
  text-align: left;
}
.stpl .stpl-table th,
.stpl .stpl-table td {
  padding: 5px 8px;
  border: 1px solid var(--stpl-border);
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}
.stpl .stpl-table th {
  background: var(--stpl-bg-sub);
  font-weight: bold;
}
.stpl .stpl-table tbody th {
  width: 14em;
}
.stpl .stpl-value {
  font-weight: bold;
}
.stpl .stpl-sub {
  margin-left: 4px;
  color: var(--stpl-muted);
  font-size: 13px;
}
.stpl tr[data-strong="true"] td {
  background: var(--stpl-strong-bg);
  color: var(--stpl-strong-fg);
}
.stpl .stpl-subhead {
  margin: 12px 0 4px;
  font-size: 14px;
  font-weight: bold;
}
.stpl .stpl-scroll {
  max-width: 100%;
  max-height: 480px;
  overflow: auto;
  margin: 0 0 8px;
}
.stpl .stpl-weeks {
  margin: 0;
}
.stpl .stpl-weeks th,
.stpl .stpl-weeks td {
  white-space: nowrap;
}
.stpl .stpl-weeks thead th {
  position: sticky;
  top: 0;
}
.stpl .stpl-weeks tbody th {
  width: auto;
}
.stpl .stpl-offscreen {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  opacity: 0;
}
@media (max-width: 600px) {
  .stpl {
    padding: 12px;
  }
  .stpl .stpl-field {
    flex: 1 1 100%;
  }
  .stpl .stpl-table tbody th {
    width: 8em;
  }
  .stpl .stpl-weeks th,
  .stpl .stpl-weeks td {
    padding: 4px 5px;
    font-size: 12px;
    white-space: normal;
  }
  .stpl .stpl-weeks tbody th {
    width: auto;
  }
  .stpl .stpl-weeks td:nth-child(2) {
    min-width: 6.5em;
  }
  .stpl .stpl-weeks td:nth-child(4),
  .stpl .stpl-weeks td:nth-child(5) {
    min-width: 5.5em;
  }
}
